diff options
author | Chris Lattner <sabre@nondot.org> | 2009-03-09 21:50:12 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-03-09 21:50:12 +0000 |
commit | da248f4f301167bb6b8253c1cd86f6760a4abb03 (patch) | |
tree | 8a0a0be165106baf05b9759dd09bcc922550c4e2 /clang/lib/Lex/Preprocessor.cpp | |
parent | c2d4b62046ea8ab484e1b5f279b742ad4e8185d2 (diff) | |
download | bcm5719-llvm-da248f4f301167bb6b8253c1cd86f6760a4abb03.tar.gz bcm5719-llvm-da248f4f301167bb6b8253c1cd86f6760a4abb03.zip |
fix PR3768, Clang does -D__STDC_HOSTED__=1, even if -ffreestanding is passed.
llvm-svn: 66474
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
-rw-r--r-- | clang/lib/Lex/Preprocessor.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index e20b42ac640..de706440c84 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/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) |