diff --git a/.gitattributes b/.gitattributes index 2e25283126..3dced6e218 100644 --- a/.gitattributes +++ b/.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 diff --git a/compiler/i386/cpupara.pas b/compiler/i386/cpupara.pas index d96b4d91bf..27118d4d06 100644 --- a/compiler/i386/cpupara.pas +++ b/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)); diff --git a/compiler/options.pas b/compiler/options.pas index fe72ad988f..4950598d5a 100644 --- a/compiler/options.pas +++ b/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); diff --git a/tests/test/packages/univint/tcgrectmake.pp b/tests/test/packages/univint/tcgrectmake.pp new file mode 100644 index 0000000000..dc903eff8b --- /dev/null +++ b/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. +