aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-09 21:50:12 +0000
committerChris Lattner <sabre@nondot.org>2009-03-09 21:50:12 +0000
commit8d4a9d37fd636684d2334c55a5eb1f4163a6746f (patch)
tree32b79bad474a884b6af91f7646eb501962ef5f2e /lib/Lex/Preprocessor.cpp
parent63c5b50d80b9843acaea0a89d425b77454ac88d9 (diff)
fix PR3768, Clang does -D__STDC_HOSTED__=1, even if -ffreestanding is passed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66474 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Preprocessor.cpp')
-rw-r--r--lib/Lex/Preprocessor.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp
index e20b42ac64..de706440c8 100644
--- a/lib/Lex/Preprocessor.cpp
+++ b/lib/Lex/Preprocessor.cpp
@@ -488,7 +488,11 @@ static void InitializePredefinedMacros(Preprocessor &PP,
else if (0) // STDC94 ?
DefineBuiltinMacro(Buf, "__STDC_VERSION__=199409L");
- DefineBuiltinMacro(Buf, "__STDC_HOSTED__=1");
+ if (PP.getLangOptions().Freestanding)
+ DefineBuiltinMacro(Buf, "__STDC_HOSTED__=0");
+ else
+ DefineBuiltinMacro(Buf, "__STDC_HOSTED__=1");
+
if (PP.getLangOptions().ObjC1) {
DefineBuiltinMacro(Buf, "__OBJC__=1");
if (PP.getLangOptions().ObjCNonFragileABI)