Skip to content

Switch C++ language standard to C++20 - #15182

Merged
cuavas merged 6 commits into
mamedev:masterfrom
cuavas:cxx20check
Apr 1, 2026
Merged

Switch C++ language standard to C++20#15182
cuavas merged 6 commits into
mamedev:masterfrom
cuavas:cxx20check

Conversation

@cuavas

@cuavas cuavas commented Apr 1, 2026

Copy link
Copy Markdown
Member
  • Switch C++ language standard to C++20
  • Increase GCC requirement to 11 (from 10.3)
  • Assume updated Windows 10 deployment target

The ugly parts of this are because C++20 makes u8"..." a different type to "..." and we want to be able to continue using them interchangeably in some places.

cuavas and others added 6 commits April 2, 2026 01:39
* emu/ioport.h: Allow char8_t for names in field configuration helper.
* emu/device.h, emu/gamedrv.h: Allow char8_t for descriptions and
  manufacturers, allow source file and manufacturer strings to be
  deduplicated.
* util/language.h: Allow char8_t message input.
@cuavas
cuavas merged commit eea4b47 into mamedev:master Apr 1, 2026
0 of 7 checks passed
@cuavas
cuavas deleted the cxx20check branch April 1, 2026 15:38
@cuavas

cuavas commented Apr 1, 2026

Copy link
Copy Markdown
Member Author

As usual, GCC and clang have differing default levels of strictness on C++20 stuff. In particular, GCC tends to be more strict on telling you not to do arithmetic/bitwise operations on different enum types, while clang is a bit more lenient on that. It may be possible to make clang stricter on those specific thing without collateral damage, but I haven't looked into it too hard yet.

@FlykeSpice

Copy link
Copy Markdown
Contributor

We are finally moving to c++20 modules?

@cuavas

cuavas commented Apr 1, 2026

Copy link
Copy Markdown
Member Author

We are finally moving to c++20 modules?

No. There are no actual working implementations of C++20 modules. It’s a misguided feature railroaded into the standard by a powerful clique. It will end up going the same way as export template.

0perator-github pushed a commit to 0perator-github/mameui that referenced this pull request Apr 2, 2026
…CC 11. (mamedev#15182)

* Hackery to allow UTF-8 strings as well as plain strings:
  - emu/ioport.h: Allow char8_t for names in field configuration helper.
  - emu/device.h, emu/gamedrv.h: Allow char8_t for descriptions and manufacturers.
  - util/language.h: Allow char8_t message input.
* util/strformat.h: Allow char8_t format and string arguments with char output.
* ui/videoopt.cpp: Deal with UTF-8 strings as a distinct type.
* osd/windows: Assume Windows 8 or later.
0perator-github pushed a commit to 0perator-github/mameui that referenced this pull request Apr 2, 2026
…CC 11. (mamedev#15182)

* Hackery to allow UTF-8 strings as well as plain strings:
  - emu/ioport.h: Allow char8_t for names in field configuration helper.
  - emu/device.h, emu/gamedrv.h: Allow char8_t for descriptions and manufacturers.
  - util/language.h: Allow char8_t message input.
* util/strformat.h: Allow char8_t format and string arguments with char output.
* ui/videoopt.cpp: Deal with UTF-8 strings as a distinct type.
* osd/windows: Assume Windows 8 or later.
0perator-github pushed a commit to 0perator-github/mameui that referenced this pull request Apr 2, 2026
…CC 11. (mamedev#15182)

* Hackery to allow UTF-8 strings as well as plain strings:
  - emu/ioport.h: Allow char8_t for names in field configuration helper.
  - emu/device.h, emu/gamedrv.h: Allow char8_t for descriptions and manufacturers.
  - util/language.h: Allow char8_t message input.
* util/strformat.h: Allow char8_t format and string arguments with char output.
* ui/videoopt.cpp: Deal with UTF-8 strings as a distinct type.
* osd/windows: Assume Windows 8 or later.
stonedDiscord pushed a commit to stonedDiscord/mame that referenced this pull request Apr 14, 2026
…CC 11. (mamedev#15182)

* Hackery to allow UTF-8 strings as well as plain strings:
  - emu/ioport.h: Allow char8_t for names in field configuration helper.
  - emu/device.h, emu/gamedrv.h: Allow char8_t for descriptions and manufacturers.
  - util/language.h: Allow char8_t message input.
* util/strformat.h: Allow char8_t format and string arguments with char output.
* ui/videoopt.cpp: Deal with UTF-8 strings as a distinct type.
* osd/windows: Assume Windows 8 or later.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants