]> granicus.if.org Git - clang/commitdiff
Avoid implicitly including any header files (requested by ckane).
authorSteve Naroff <snaroff@apple.com>
Fri, 4 Apr 2008 22:58:22 +0000 (22:58 +0000)
committerSteve Naroff <snaroff@apple.com>
Fri, 4 Apr 2008 22:58:22 +0000 (22:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49241 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/RewriteTest.cpp

index 145c766d70d4dade66f4a6949148e6d898036f32..26bfa01b26868069db7f32c9d566e9d66894aa87 100644 (file)
@@ -327,11 +327,10 @@ void RewriteTest::Initialize(ASTContext &context) {
   Preamble += "extern Protocol *objc_getProtocol(const char *);\n";
   if (LangOpts.Microsoft) 
     Preamble += "} // end extern \"C\"\n";
-  Preamble += "#include <objc/objc.h>\n";
   Preamble += "#ifndef __FASTENUMERATIONSTATE\n";
   Preamble += "struct __objcFastEnumerationState {\n\t";
   Preamble += "unsigned long state;\n\t";
-  Preamble += "id *itemsPtr;\n\t";
+  Preamble += "void **itemsPtr;\n\t";
   Preamble += "unsigned long *mutationsPtr;\n\t";
   Preamble += "unsigned long extra[5];\n};\n";
   Preamble += "#define __FASTENUMERATIONSTATE\n";
@@ -2912,8 +2911,7 @@ void RewriteTest::RewriteImplementations(std::string &Result) {
     RewriteImplementationDecl(CategoryImplementation[i]);
   
   // This is needed for use of offsetof
-  Result += "#include <stddef.h>\n";
-    
+  Result += "#define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER)\n";   
   // For each implemented class, write out all its meta data.
   for (int i = 0; i < ClsDefCount; i++)
     RewriteObjCClassMetaData(ClassImplementation[i], Result);