aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-10-28 23:02:54 +0000
committerDouglas Gregor <dgregor@apple.com>2011-10-28 23:02:54 +0000
commit5aa6dea4efe19f4c2e6600364123fb8899ec4af7 (patch)
treed960a8c447b9366fc70a61cf35ab8829ff3d7fb4 /lib/Frontend
parentdfca64ddfbdbc48085119f7c943d05881899bf5e (diff)
Give __STDC_VERSION__ the value 201001L when we're in C1x mode. The
committee hasn't set a value for __STDC_VERSION__ yet, so this is a placeholder. But at least it's > 199901L. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143245 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend')
-rw-r--r--lib/Frontend/InitPreprocessor.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp
index 1f2f4256d3..d0a87bd888 100644
--- a/lib/Frontend/InitPreprocessor.cpp
+++ b/lib/Frontend/InitPreprocessor.cpp
@@ -286,7 +286,12 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
Builder.defineMacro("__STDC_HOSTED__");
if (!LangOpts.CPlusPlus) {
- if (LangOpts.C99)
+ // FIXME: C1x doesn't have a defined version number yet, so pick something
+ // that is the minimum possible according to their placeholder scheme
+ // 201ymmL.
+ if (LangOpts.C1X)
+ Builder.defineMacro("__STDC_VERSION__", "201001L");
+ else if (LangOpts.C99)
Builder.defineMacro("__STDC_VERSION__", "199901L");
else if (!LangOpts.GNUMode && LangOpts.Digraphs)
Builder.defineMacro("__STDC_VERSION__", "199409L");