aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/_types.h
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2013-05-25 16:58:12 +0000
committerEd Schouten <ed@FreeBSD.org>2013-05-25 16:58:12 +0000
commit74b6b2bb9903e0b210d52e9e903aa28a594babe1 (patch)
treed7543b18f91b77824ad2ce6bec9030e0b3531164 /sys/sys/_types.h
parentaf8e44c84ab9d4144964b049e554ad1c322d983f (diff)
downloadsrc-74b6b2bb9903e0b210d52e9e903aa28a594babe1.tar.gz
src-74b6b2bb9903e0b210d52e9e903aa28a594babe1.zip
Fix <uchar.h> in for C++11.
It turns out that in C++11, char16_t and char32_t are built-in types; language keywords. Just fix this by putting traditional _*_T_DECLARED blocks around the definitions. We'll just predefine these in <sys/_types.h>. This also opens up the possibility to define char16_t in other header files, if ever needed (e.g. if we would gain a <ctype.h> for char16_t/char32_t).
Notes
Notes: svn path=/head/; revision=250985
Diffstat (limited to 'sys/sys/_types.h')
-rw-r--r--sys/sys/_types.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/sys/_types.h b/sys/sys/_types.h
index e47749faaa90..34d1edbd8eab 100644
--- a/sys/sys/_types.h
+++ b/sys/sys/_types.h
@@ -94,6 +94,11 @@ typedef __ct_rune_t __wint_t; /* wint_t (see above) */
typedef __uint_least16_t __char16_t;
typedef __uint_least32_t __char32_t;
#endif
+/* In C++11, char16_t and char32_t are built-in types. */
+#if defined(__cplusplus) && __cplusplus >= 201103L
+#define _CHAR16_T_DECLARED
+#define _CHAR32_T_DECLARED
+#endif
typedef __uint32_t __dev_t; /* device number */