mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 07:39:25 +02:00
* fixed alignment of double, extended, int64 and qword on i386-darwin
git-svn-id: trunk@2870 -
This commit is contained in:
parent
eb5d494b12
commit
659d3e106d
@ -365,6 +365,7 @@ interface
|
||||
procedure ppuwrite(ppufile:tcompilerppufile);override;
|
||||
function is_publishable : boolean;override;
|
||||
function gettypename:string;override;
|
||||
function alignment:longint;override;
|
||||
procedure setsize;
|
||||
function getvartype : longint;override;
|
||||
{ rtti }
|
||||
@ -379,6 +380,7 @@ interface
|
||||
procedure ppuwrite(ppufile:tcompilerppufile);override;
|
||||
function gettypename:string;override;
|
||||
function is_publishable : boolean;override;
|
||||
function alignment:longint;override;
|
||||
procedure setsize;
|
||||
function getvartype:longint;override;
|
||||
{ rtti }
|
||||
@ -1620,6 +1622,16 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
function torddef.alignment:longint;
|
||||
begin
|
||||
if (target_info.system = system_i386_darwin) and
|
||||
(typ in [s64bit,u64bit]) then
|
||||
result := 4
|
||||
else
|
||||
result := inherited alignment;
|
||||
end;
|
||||
|
||||
|
||||
procedure torddef.setsize;
|
||||
const
|
||||
sizetbl : array[tbasetype] of longint = (
|
||||
@ -1786,6 +1798,22 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
function tfloatdef.alignment:longint;
|
||||
begin
|
||||
if (target_info.system = system_i386_darwin) then
|
||||
case typ of
|
||||
s80real : result:=16;
|
||||
s64real,
|
||||
s64currency,
|
||||
s64comp : result:=4;
|
||||
else
|
||||
result := inherited alignment;
|
||||
end
|
||||
else
|
||||
result := inherited alignment;
|
||||
end;
|
||||
|
||||
|
||||
procedure tfloatdef.setsize;
|
||||
begin
|
||||
case typ of
|
||||
|
@ -941,10 +941,6 @@ implementation
|
||||
fieldalignment:=4
|
||||
else if (varalign>1) and (fieldalignment<2) then
|
||||
fieldalignment:=2;
|
||||
{ darwin/x86 aligns long doubles on 16 bytes }
|
||||
if (target_info.system = system_i386_darwin) and
|
||||
(fieldalignment = 12) then
|
||||
fieldalignment := 16;
|
||||
end;
|
||||
fieldalignment:=min(fieldalignment,aktalignment.maxCrecordalign);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user