]> granicus.if.org Git - clang/commitdiff
define __STDC_VERSION__ processor token for c94
authorRyan Flynn <pizza@parseerror.com>
Tue, 21 Jul 2009 00:07:02 +0000 (00:07 +0000)
committerRyan Flynn <pizza@parseerror.com>
Tue, 21 Jul 2009 00:07:02 +0000 (00:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76514 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/InitPreprocessor.cpp

index e41dfdda07e93661b25751df26ae8c71f66bbb77..3ab59315c8b1e3a54ed1233e1d20046b626701fb 100644 (file)
@@ -247,10 +247,13 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
     DefineBuiltinMacro(Buf, "__STDC__=1");
   if (LangOpts.AsmPreprocessor)
     DefineBuiltinMacro(Buf, "__ASSEMBLER__=1");
-  if (LangOpts.C99 && !LangOpts.CPlusPlus)
-    DefineBuiltinMacro(Buf, "__STDC_VERSION__=199901L");
-  else if (0) // STDC94 ?
-    DefineBuiltinMacro(Buf, "__STDC_VERSION__=199409L");
+
+  if (!LangOpts.CPlusPlus) {
+    if (LangOpts.C99)
+      DefineBuiltinMacro(Buf, "__STDC_VERSION__=199901L");
+    else if (!LangOpts.GNUMode && LangOpts.Digraphs)
+      DefineBuiltinMacro(Buf, "__STDC_VERSION__=199409L");
+  }
 
   // Standard conforming mode?
   if (!LangOpts.GNUMode)