don't define wchar_t on c++
authorRich Felker <dalias@aerifal.cx>
Sat, 15 Oct 2011 04:28:49 +0000 (00:28 -0400)
committerRich Felker <dalias@aerifal.cx>
Sat, 15 Oct 2011 04:28:49 +0000 (00:28 -0400)
it's a keyword in c++ (wtf). i'm not sure this is the cleanest
solution; it might be better to avoid ever defining __NEED_wchar_t on
c++. but in any case, this works for now.

arch/arm/bits/alltypes.h.sh
arch/i386/bits/alltypes.h.sh
arch/x86_64/bits/alltypes.h.sh

index 11f1d93..af73e66 100755 (executable)
@@ -22,7 +22,9 @@ TYPEDEF long ptrdiff_t;
 
 TYPEDEF __builtin_va_list va_list;
 
+#ifndef __cplusplus
 TYPEDEF unsigned wchar_t;
+#endif
 TYPEDEF int wint_t;
 TYPEDEF long wctrans_t;
 TYPEDEF long wctype_t;
index 672d6a4..5aacc29 100755 (executable)
@@ -26,11 +26,13 @@ TYPEDEF __builtin_va_list va_list;
 TYPEDEF struct __va_list * va_list;
 #endif
 
+#ifndef __cplusplus
 #ifdef __WCHAR_TYPE__
 TYPEDEF __WCHAR_TYPE__ wchar_t;
 #else
 TYPEDEF long wchar_t;
 #endif
+#endif
 TYPEDEF long wint_t;
 TYPEDEF long wctrans_t;
 TYPEDEF long wctype_t;
index 19843bd..10fc3d5 100755 (executable)
@@ -21,7 +21,9 @@ TYPEDEF long ssize_t;
 TYPEDEF long ptrdiff_t;
 TYPEDEF __builtin_va_list va_list;
 
+#ifndef __cplusplus
 TYPEDEF int wchar_t;
+#endif
 TYPEDEF int wint_t;
 TYPEDEF int wctrans_t;
 TYPEDEF int wctype_t;