]> granicus.if.org Git - clang/commitdiff
get __WCHAR_TYPE__ from the targetinfo hook
authorChris Lattner <sabre@nondot.org>
Fri, 6 Feb 2009 05:06:07 +0000 (05:06 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 6 Feb 2009 05:06:07 +0000 (05:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63920 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/Preprocessor.cpp

index c1e852cd2a2b143a5d865300babd3ea230dfdba0..9b5965ccc51b5195bcf21a4418d98c8b7a4f3b9b 100644 (file)
@@ -525,9 +525,6 @@ static void InitializePredefinedMacros(Preprocessor &PP,
   assert(TI.getCharWidth() == 8 && "Only support 8-bit char so far");
   DefineBuiltinMacro(Buf, "__CHAR_BIT__=8");
 
-  DefineBuiltinMacro(Buf, "__WCHAR_TYPE__=int");
-  DefineBuiltinMacro(Buf, "__WINT_TYPE__=int");
-  
   unsigned IntMaxWidth;
   const char *IntMaxSuffix;
   if (TI.getIntMaxType() == TargetInfo::SignedLongLong) {
@@ -554,7 +551,10 @@ static void InitializePredefinedMacros(Preprocessor &PP,
   DefineType("__UINTMAX_TYPE__", TI.getUIntMaxType(), Buf);
   DefineType("__PTRDIFF_TYPE__", TI.getPtrDiffType(0), Buf);
   DefineType("__SIZE_TYPE__", TI.getSizeType(), Buf);
-    
+  DefineType("__WCHAR_TYPE__", TI.getWCharType(), Buf);
+  // FIXME: TargetInfo hookize __WINT_TYPE__.
+  DefineBuiltinMacro(Buf, "__WINT_TYPE__=int");
+  
   DefineFloatMacros(Buf, "FLT", &TI.getFloatFormat());
   DefineFloatMacros(Buf, "DBL", &TI.getDoubleFormat());
   DefineFloatMacros(Buf, "LDBL", &TI.getLongDoubleFormat());