summaryrefslogtreecommitdiff
path: root/include/uchar.h
diff options
context:
space:
mode:
authorSzabolcs Nagy <nsz@port70.net>2018-07-08 15:19:03 +0200
committerRich Felker <dalias@aerifal.cx>2018-07-17 22:24:03 -0400
commitcbf16c4abf63e47c2e8b34faac8a2a74a64973b5 (patch)
treeafc8130e333b3dbaf1fd1a5f7f05ba4164e00371 /include/uchar.h
parent5c2f46a214fceeee3c3e41700c51415e0a4f1acd (diff)
downloadmusl-cbf16c4abf63e47c2e8b34faac8a2a74a64973b5.tar.gz
uchar.h: define char16_t and char32_t for old c++
including uchar.h in c++ code is only well defined in c++11 onwards where char16_t and char32_t type definitions must be hidden since they are keywords. however some c++ code compiled for older c++ standard include uchar.h too and they need the typedefs, this fix makes such code work.
Diffstat (limited to 'include/uchar.h')
-rw-r--r--include/uchar.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/uchar.h b/include/uchar.h
index 8dabf1ed..7e5c4d40 100644
--- a/include/uchar.h
+++ b/include/uchar.h
@@ -3,7 +3,9 @@
#ifdef __cplusplus
extern "C" {
-#else
+#endif
+
+#if __cplusplus < 201103L
typedef unsigned short char16_t;
typedef unsigned char32_t;
#endif