aboutsummaryrefslogtreecommitdiff
path: root/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Lex/Preprocessor.cpp')
-rw-r--r--Lex/Preprocessor.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lex/Preprocessor.cpp b/Lex/Preprocessor.cpp
index ba96fad92c..7deea40548 100644
--- a/Lex/Preprocessor.cpp
+++ b/Lex/Preprocessor.cpp
@@ -369,6 +369,13 @@ static void InitializePredefinedMacros(Preprocessor &PP,
DefineBuiltinMacro(Buf, "__OBJC__=1");
if (PP.getLangOptions().ObjC2)
DefineBuiltinMacro(Buf, "__OBJC2__=1");
+
+ if (PP.getLangOptions().ObjC1) {
+ // FIXME: make this the right thing.
+ const char *IDTypedef = "/*typedef int id;*/\n";
+ Buf.insert(Buf.end(), IDTypedef, IDTypedef+strlen(IDTypedef));
+ }
+
// Get the target #defines.
PP.getTargetInfo().getTargetDefines(Buf);