Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 01 Jan 2026 22:21:35 +0000
From:      Robert Clausecker <fuz@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 2ff4e6ac0d9f - stable/15 - sys/_types.h: recognise char8_t as a builtin type in C++20
Message-ID:  <6956f36f.f435.41139540@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch stable/15 has been updated by fuz:

URL: https://cgit.FreeBSD.org/src/commit/?id=2ff4e6ac0d9f3f4ef477d15c40da04a87f5b7578

commit 2ff4e6ac0d9f3f4ef477d15c40da04a87f5b7578
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2025-12-07 23:49:05 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2026-01-01 20:51:52 +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
    
    (cherry picked from commit 66129def7bdaf8a0447aba55e736d27687204555)
---
 sys/sys/_types.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/sys/_types.h b/sys/sys/_types.h
index 6b70b8dc6e32..02d01f86b298 100644
--- a/sys/sys/_types.h
+++ b/sys/sys/_types.h
@@ -177,6 +177,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


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6956f36f.f435.41139540>