mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 06:19:19 +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;
|
procedure ppuwrite(ppufile:tcompilerppufile);override;
|
||||||
function is_publishable : boolean;override;
|
function is_publishable : boolean;override;
|
||||||
function gettypename:string;override;
|
function gettypename:string;override;
|
||||||
|
function alignment:longint;override;
|
||||||
procedure setsize;
|
procedure setsize;
|
||||||
function getvartype : longint;override;
|
function getvartype : longint;override;
|
||||||
{ rtti }
|
{ rtti }
|
||||||
@ -379,6 +380,7 @@ interface
|
|||||||
procedure ppuwrite(ppufile:tcompilerppufile);override;
|
procedure ppuwrite(ppufile:tcompilerppufile);override;
|
||||||
function gettypename:string;override;
|
function gettypename:string;override;
|
||||||
function is_publishable : boolean;override;
|
function is_publishable : boolean;override;
|
||||||
|
function alignment:longint;override;
|
||||||
procedure setsize;
|
procedure setsize;
|
||||||
function getvartype:longint;override;
|
function getvartype:longint;override;
|
||||||
{ rtti }
|
{ rtti }
|
||||||
@ -1620,6 +1622,16 @@ implementation
|
|||||||
end;
|
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;
|
procedure torddef.setsize;
|
||||||
const
|
const
|
||||||
sizetbl : array[tbasetype] of longint = (
|
sizetbl : array[tbasetype] of longint = (
|
||||||
@ -1786,6 +1798,22 @@ implementation
|
|||||||
end;
|
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;
|
procedure tfloatdef.setsize;
|
||||||
begin
|
begin
|
||||||
case typ of
|
case typ of
|
||||||
|
@ -941,10 +941,6 @@ implementation
|
|||||||
fieldalignment:=4
|
fieldalignment:=4
|
||||||
else if (varalign>1) and (fieldalignment<2) then
|
else if (varalign>1) and (fieldalignment<2) then
|
||||||
fieldalignment:=2;
|
fieldalignment:=2;
|
||||||
{ darwin/x86 aligns long doubles on 16 bytes }
|
|
||||||
if (target_info.system = system_i386_darwin) and
|
|
||||||
(fieldalignment = 12) then
|
|
||||||
fieldalignment := 16;
|
|
||||||
end;
|
end;
|
||||||
fieldalignment:=min(fieldalignment,aktalignment.maxCrecordalign);
|
fieldalignment:=min(fieldalignment,aktalignment.maxCrecordalign);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user