From: Ryan Flynn Date: Tue, 21 Jul 2009 00:07:02 +0000 (+0000) Subject: define __STDC_VERSION__ processor token for c94 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=07ef804f918d8aade8739a02e78c6209fd3062a9;p=clang define __STDC_VERSION__ processor token for c94 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76514 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp index e41dfdda07..3ab59315c8 100644 --- a/lib/Frontend/InitPreprocessor.cpp +++ b/lib/Frontend/InitPreprocessor.cpp @@ -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)