浏览代码

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.
Szabolcs Nagy 6 年之前
父节点
当前提交
cbf16c4abf
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      include/uchar.h

+ 3 - 1
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