aboutsummaryrefslogtreecommitdiff
path: root/Driver/RewriteObjC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Driver/RewriteObjC.cpp')
-rw-r--r--Driver/RewriteObjC.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Driver/RewriteObjC.cpp b/Driver/RewriteObjC.cpp
index cf715d0cdc..3f40e4a67a 100644
--- a/Driver/RewriteObjC.cpp
+++ b/Driver/RewriteObjC.cpp
@@ -330,8 +330,6 @@ void RewriteObjC::Initialize(ASTContext &context) {
Preamble += "__OBJC_RW_EXTERN int objc_exception_match";
Preamble += "(struct objc_class *, struct objc_object *);\n";
Preamble += "__OBJC_RW_EXTERN Protocol *objc_getProtocol(const char *);\n";
- if (LangOpts.Microsoft)
- Preamble += "#undef __OBJC_RW_EXTERN\n";
Preamble += "#ifndef __FASTENUMERATIONSTATE\n";
Preamble += "struct __objcFastEnumerationState {\n\t";
Preamble += "unsigned long state;\n\t";
@@ -347,11 +345,13 @@ void RewriteObjC::Initialize(ASTContext &context) {
Preamble += " char *str;\n";
Preamble += " long length;\n";
Preamble += "};\n";
- Preamble += "extern int __CFConstantStringClassReference[];\n";
+ Preamble += "__OBJC_RW_EXTERN int __CFConstantStringClassReference[];\n";
Preamble += "#define __NSCONSTANTSTRINGIMPL\n";
Preamble += "#endif\n";
- if (LangOpts.Microsoft)
+ if (LangOpts.Microsoft) {
+ Preamble += "#undef __OBJC_RW_EXTERN\n";
Preamble += "#define __attribute__(X)\n";
+ }
}