diff options
| author | Robert Clausecker <fuz@FreeBSD.org> | 2025-12-07 23:49:05 +0000 |
|---|---|---|
| committer | Robert Clausecker <fuz@FreeBSD.org> | 2025-12-09 13:16:31 +0000 |
| commit | 66129def7bdaf8a0447aba55e736d27687204555 (patch) | |
| tree | 40929a1234806a2dfc6ec8b7ac4ecd60b977c2ea | |
| parent | f88300a7b56e32808e91fc893e7f1afc67ce72fd (diff) | |
sys/_types.h: recognise char8_t as a builtin type in C++20
Unlike in C23 where it's a typedef, char8_t is a built in type in
C++20. Recognise it as such.
PR: 291449
Reported by: Tomoaki AOKI <junchoon@dec.sakura.ne.jp>
Approved by: markj (mentor)
Reviewed by: imp
Fixes: f0e541118c374869a8226eaa1320bb6eda248a20
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D54124
| -rw-r--r-- | sys/sys/_types.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/sys/_types.h b/sys/sys/_types.h index 4e217704ceb6..2e622090e81d 100644 --- a/sys/sys/_types.h +++ b/sys/sys/_types.h @@ -207,6 +207,10 @@ typedef __uint_least32_t __char32_t; #define _CHAR16_T_DECLARED #define _CHAR32_T_DECLARED #endif +/* and so is char8_t in C++20 */ +#if defined(__cplusplus) && __cplusplus >= 202002L +#define _CHAR8_T_DECLARED +#endif typedef struct { long long __max_align1 |
