From: Chris Lattner Date: Sun, 22 Jul 2007 22:11:35 +0000 (+0000) Subject: GCC doesn't set __STDC_VERSION__ usually. It never sets it in X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=94fea5a9560715e2d303c06e173a5668911cca79;p=clang GCC doesn't set __STDC_VERSION__ usually. It never sets it in C++ mode, even gnu C++ mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40408 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Driver/clang.cpp b/Driver/clang.cpp index 6016b9a50a..7d8a4590f1 100644 --- a/Driver/clang.cpp +++ b/Driver/clang.cpp @@ -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");