Browse Source

* look in the iPhoneAll unit for NSFastEnumeration* types on iOS/iphonesim,
instead of in the CocoaAll unit

git-svn-id: trunk@22611 -

Jonas Maebe 12 years ago
parent
commit
b1d661d774
1 changed files with 8 additions and 3 deletions
  1. 8 3
      compiler/symdef.pas

+ 8 - 3
compiler/symdef.pas

@@ -6819,19 +6819,24 @@ implementation
     procedure maybeloadcocoatypes;
     procedure maybeloadcocoatypes;
       var
       var
         tsym: ttypesym;
         tsym: ttypesym;
+        cocoaunit: string[15];
       begin
       begin
         if assigned(objc_fastenumeration) then
         if assigned(objc_fastenumeration) then
           exit;
           exit;
-        tsym:=search_named_unit_globaltype('COCOAALL','NSFASTENUMERATIONPROTOCOL',false);
+        if not(target_info.system in [system_arm_darwin,system_i386_iphonesim]) then
+          cocoaunit:='COCOAALL'
+        else
+          cocoaunit:='IPHONEALL';
+        tsym:=search_named_unit_globaltype(cocoaunit,'NSFASTENUMERATIONPROTOCOL',false);
         if assigned(tsym) then
         if assigned(tsym) then
           objc_fastenumeration:=tobjectdef(tsym.typedef)
           objc_fastenumeration:=tobjectdef(tsym.typedef)
         else
         else
           objc_fastenumeration:=nil;
           objc_fastenumeration:=nil;
-        tsym:=search_named_unit_globaltype('COCOAALL','NSFASTENUMERATIONSTATE',false);
+        tsym:=search_named_unit_globaltype(cocoaunit,'NSFASTENUMERATIONSTATE',false);
         if assigned(tsym) then
         if assigned(tsym) then
           objc_fastenumerationstate:=trecorddef(tsym.typedef)
           objc_fastenumerationstate:=trecorddef(tsym.typedef)
         else
         else
-        objc_fastenumerationstate:=nil;
+          objc_fastenumerationstate:=nil;
       end;
       end;