]> granicus.if.org Git - clang/commitdiff
GCC doesn't set __STDC_VERSION__ usually. It never sets it in
authorChris Lattner <sabre@nondot.org>
Sun, 22 Jul 2007 22:11:35 +0000 (22:11 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 22 Jul 2007 22:11:35 +0000 (22:11 +0000)
C++ mode, even gnu C++ mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40408 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/clang.cpp

index 6016b9a50afa4b9c985e4208e2a868a0dd0ee183..7d8a4590f1231b32d9f98b6c8b9fd2d09023433c 100644 (file)
@@ -391,9 +391,9 @@ static void InitializePredefinedMacros(Preprocessor &PP,
   // current language configuration.
   DefineBuiltinMacro(Buf, "__STDC__=1");
   //DefineBuiltinMacro(Buf, "__ASSEMBLER__=1");
-  if (PP.getLangOptions().C99)
+  if (PP.getLangOptions().C99 && !PP.getLangOptions().CPlusPlus)
     DefineBuiltinMacro(Buf, "__STDC_VERSION__=199901L");
-  else
+  else if (0) // STDC94 ?
     DefineBuiltinMacro(Buf, "__STDC_VERSION__=199409L");
   
   DefineBuiltinMacro(Buf, "__STDC_HOSTED__=1");