[cfe-commits] r84227 - /cfe/trunk/lib/Frontend/InitPreprocessor.cpp

John Thompson John.Thompson.JTSoftware at gmail.com
Thu Oct 15 18:12:00 PDT 2009


Author: jtsoftware
Date: Thu Oct 15 20:12:00 2009
New Revision: 84227

URL: http://llvm.org/viewvc/llvm-project?rev=84227&view=rev
Log:
Work-around wchar_t and __pragma problem in VC headers

Modified:
    cfe/trunk/lib/Frontend/InitPreprocessor.cpp

Modified: cfe/trunk/lib/Frontend/InitPreprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitPreprocessor.cpp?rev=84227&r1=84226&r2=84227&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/InitPreprocessor.cpp (original)
+++ cfe/trunk/lib/Frontend/InitPreprocessor.cpp Thu Oct 15 20:12:00 2009
@@ -317,13 +317,22 @@
     DefineBuiltinMacro(Buf, "_GNU_SOURCE=1");
   }
 
-  // Filter out some microsoft extensions when trying to parse in ms-compat
-  // mode.
   if (LangOpts.Microsoft) {
+    // Filter out some microsoft extensions when trying to parse in ms-compat
+    // mode.
     DefineBuiltinMacro(Buf, "__int8=__INT8_TYPE__");
     DefineBuiltinMacro(Buf, "__int16=__INT16_TYPE__");
     DefineBuiltinMacro(Buf, "__int32=__INT32_TYPE__");
     DefineBuiltinMacro(Buf, "__int64=__INT64_TYPE__");
+    // Work around some issues with Visual C++ headerws.
+    if (LangOpts.CPlusPlus) {
+      // Since we define wchar_t in C++ mode.
+      DefineBuiltinMacro(Buf, "_WCHAR_T_DEFINED=1");
+      DefineBuiltinMacro(Buf, "_NATIVE_WCHAR_T_DEFINED=1");
+      // FIXME:  This should be temporary until we have a __pragma
+      // solution, to avoid some errors flagged in VC++ headers.
+      DefineBuiltinMacro(Buf, "_CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES=0");
+    }
   }
 
   if (LangOpts.Optimize)





More information about the cfe-commits mailing list