aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRobert Clausecker <fuz@FreeBSD.org>2025-11-27 17:57:02 +0000
committerRobert Clausecker <fuz@FreeBSD.org>2026-01-01 20:47:33 +0000
commit72609bb2bb25710871157792715213ef71a51521 (patch)
tree8533492b75257f19dd31db8d7bd0619427290740 /include
parent35787967e87679511c906fbcb7dbccb31fd1ef33 (diff)
uchar.h: add char8_t
A type similar to char16 and char32_t, for compliance with C23. The related type atomic_char8_t is added to stdatomic.h. As char8_t is always unsigned char, I've skipped adding __char8_t. This can be added, too, if desired. Reviewed by: imp Approved by: markj (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D53952 (cherry picked from commit f0e541118c374869a8226eaa1320bb6eda248a20)
Diffstat (limited to 'include')
-rw-r--r--include/uchar.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/uchar.h b/include/uchar.h
index 951c6339abec..ebb2c89776b8 100644
--- a/include/uchar.h
+++ b/include/uchar.h
@@ -32,6 +32,11 @@
#include <sys/cdefs.h>
#include <sys/_types.h>
+#if __ISO_C_VISIBLE >= 2023 && !defined(_CHAR8_T_DECLARED)
+typedef unsigned char char8_t;
+#define _CHAR8_T_DECLARED
+#endif
+
#ifndef _CHAR16_T_DECLARED
typedef __char16_t char16_t;
#define _CHAR16_T_DECLARED