[cfe-commits] r76514 - /cfe/trunk/lib/Frontend/InitPreprocessor.cpp
Ryan Flynn
pizza at parseerror.com
Mon Jul 20 17:07:03 PDT 2009
Author: pizza
Date: Mon Jul 20 19:07:02 2009
New Revision: 76514
URL: http://llvm.org/viewvc/llvm-project?rev=76514&view=rev
Log:
define __STDC_VERSION__ processor token for c94
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=76514&r1=76513&r2=76514&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/InitPreprocessor.cpp (original)
+++ cfe/trunk/lib/Frontend/InitPreprocessor.cpp Mon Jul 20 19:07:02 2009
@@ -247,10 +247,13 @@
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)
More information about the cfe-commits
mailing list