mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 23:59:10 +02:00
* made safecall working, handling not consistent yet though
git-svn-id: trunk@3418 -
This commit is contained in:
parent
acc016c9ec
commit
a5dfe315ec
@ -99,25 +99,31 @@ unit cpupara;
|
|||||||
case target_info.system of
|
case target_info.system of
|
||||||
system_i386_win32 :
|
system_i386_win32 :
|
||||||
begin
|
begin
|
||||||
case def.deftype of
|
if calloption=pocall_safecall then
|
||||||
recorddef :
|
begin
|
||||||
begin
|
result:=true;
|
||||||
{ Win32 GCC returns small records in the FUNCTION_RETURN_REG.
|
exit;
|
||||||
For stdcall we follow delphi instead of GCC }
|
end
|
||||||
if (calloption in [pocall_cdecl,pocall_cppdecl]) and
|
else
|
||||||
(def.size>0) and
|
case def.deftype of
|
||||||
(def.size<=8) then
|
recorddef :
|
||||||
begin
|
begin
|
||||||
result:=false;
|
{ Win32 GCC returns small records in the FUNCTION_RETURN_REG.
|
||||||
exit;
|
For stdcall we follow delphi instead of GCC }
|
||||||
end;
|
if (calloption in [pocall_cdecl,pocall_cppdecl]) and
|
||||||
end;
|
(def.size>0) and
|
||||||
end;
|
(def.size<=8) then
|
||||||
|
begin
|
||||||
|
result:=false;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
system_i386_darwin :
|
system_i386_darwin :
|
||||||
begin
|
begin
|
||||||
case def.deftype of
|
case def.deftype of
|
||||||
recorddef :
|
recorddef :
|
||||||
begin
|
begin
|
||||||
size := def.size;
|
size := def.size;
|
||||||
if (size > 0) and
|
if (size > 0) and
|
||||||
|
@ -101,7 +101,7 @@ implementation
|
|||||||
akttokenpos:=tprocdef(pd).fileinfo;
|
akttokenpos:=tprocdef(pd).fileinfo;
|
||||||
|
|
||||||
{ For left to right add it at the end to be delphi compatible }
|
{ For left to right add it at the end to be delphi compatible }
|
||||||
if pd.proccalloption in pushleftright_pocalls then
|
if pd.proccalloption in (pushleftright_pocalls+[pocall_safecall]) then
|
||||||
paranr:=paranr_result_leftright
|
paranr:=paranr_result_leftright
|
||||||
else
|
else
|
||||||
paranr:=paranr_result;
|
paranr:=paranr_result;
|
||||||
|
Loading…
Reference in New Issue
Block a user