aboutsummaryrefslogtreecommitdiff
path: root/Driver/RewriteObjC.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-05-15 21:12:10 +0000
committerSteve Naroff <snaroff@apple.com>2008-05-15 21:12:10 +0000
commit73b17cd017f70d0bf7ca2dbb12f09f99081d7fdb (patch)
tree044df123bead386197f3ba84291964684eec1afa /Driver/RewriteObjC.cpp
parentcf6223c52af888d4375e0d75553da8d783b9705a (diff)
Fix rewriter bug <rdar://problem/5929344> clang ObjC rewriter: "extern int __CFConstantStringClassReference[];" should be extern "C".
Have clang predefine OBJC_NEW_PROPERTIES (which is what gcc does). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51163 91177308-0d34-0410-b5e6-96231b3b80d8
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";
+ }
}