2
0
Эх сурвалжийг харах

* added pocall_mwpascal to cdecl_pocalls so we no longer have to explicitly
add it everywhere in the paramanagers (where it was often forgotten)
- removed places where it was explicitly added to cdecl_pocalls checks
+ test

git-svn-id: trunk@22616 -

Jonas Maebe 12 жил өмнө
parent
commit
614436d8cb

+ 1 - 0
.gitattributes

@@ -10369,6 +10369,7 @@ tests/test/packages/fcl-xml/tw22495.pp svneol=native#text/plain
 tests/test/packages/fcl-xml/uw22495.pp svneol=native#text/plain
 tests/test/packages/hash/sha1test.pp svneol=native#text/plain
 tests/test/packages/hash/tmdtest.pp svneol=native#text/plain
+tests/test/packages/univint/tcgrectmake.pp svneol=native#text/plain
 tests/test/packages/webtbs/tw10045.pp svneol=native#text/plain
 tests/test/packages/webtbs/tw11142.pp svneol=native#text/plain
 tests/test/packages/webtbs/tw11570.pp svneol=native#text/plain

+ 1 - 1
compiler/i386/cpupara.pas

@@ -193,7 +193,7 @@ unit cpupara;
                 result:=false
               else
                 result:=
-                  (not(calloption in (cdecl_pocalls+[pocall_mwpascal])) and
+                  (not(calloption in (cdecl_pocalls)) and
                    (def.size>sizeof(aint))) or
                   (((calloption = pocall_mwpascal) or (target_info.system=system_i386_wince)) and
                    (varspez=vs_const));

+ 1 - 1
compiler/options.pas

@@ -3309,7 +3309,7 @@ if (target_info.abi = abi_eabihf) then
   Option:=nil;
 
   clearstack_pocalls := [pocall_cdecl,pocall_cppdecl,pocall_syscall,pocall_mwpascal];
-  cdecl_pocalls := [pocall_cdecl, pocall_cppdecl];
+  cdecl_pocalls := [pocall_cdecl, pocall_cppdecl, pocall_mwpascal];
   if (tf_safecall_clearstack in target_info.flags) then
     begin
       include (cdecl_pocalls, pocall_safecall);

+ 16 - 0
tests/test/packages/univint/tcgrectmake.pp

@@ -0,0 +1,16 @@
+{ %target=darwin }
+program test;
+uses
+	MacOSAll;
+
+procedure Callback (data: ptr; context: ptr); mwpascal;
+begin
+end;
+
+var
+	arr: CFMutableArrayRef;
+begin
+	arr := CFArrayCreateMutable(nil, 0, @kCFTypeArrayCallBacks);
+	CFArrayApplyFunction(arr, CFRangeMake(0, CFArrayGetCount(arr)), CFArrayApplierFunction(@Callback), nil);
+end.
+