git: 66129def7bda - main - sys/_types.h: recognise char8_t as a builtin type in C++20
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 09 Dec 2025 13:16:59 UTC
The branch main has been updated by fuz:
URL: https://cgit.FreeBSD.org/src/commit/?id=66129def7bdaf8a0447aba55e736d27687204555
commit 66129def7bdaf8a0447aba55e736d27687204555
Author: Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2025-12-07 23:49:05 +0000
Commit: Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2025-12-09 13:16:31 +0000
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
---
sys/sys/_types.h | 4 ++++
1 file changed, 4 insertions(+)
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