]> granicus.if.org Git - clang/commitdiff
Avoid redefinition of __objcFastEnumerationState
authorFariborz Jahanian <fjahanian@apple.com>
Thu, 10 Jan 2008 23:04:06 +0000 (23:04 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Thu, 10 Jan 2008 23:04:06 +0000 (23:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45842 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/RewriteTest.cpp

index 529f524d59ffb837d2b5aed58964d21261b055e0..6f6bfc23546d7e980c7f55cec56c8f56dcacf6f1 100644 (file)
@@ -122,11 +122,14 @@ namespace {
                       "(struct objc_class *, struct objc_object *, ...);\n"
                       "extern Protocol *objc_getProtocol(const char *);\n"
                       "#include <objc/objc.h>\n"
+                      "#ifndef __FASTENUMERATIONSTATE\n"
                       "struct __objcFastEnumerationState {\n\t"
                       "unsigned long state;\n\t"
                       "id *itemsPtr;\n\t"
                       "unsigned long *mutationsPtr;\n\t"
-                      "unsigned long extra[5];\n};\n";
+                      "unsigned long extra[5];\n};\n"
+                      "#define __FASTENUMERATIONSTATE\n"
+                      "#endif\n";
                       
       Rewrite.InsertText(SourceLocation::getFileLoc(MainFileID, 0), 
                          s, strlen(s));