mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-12 22:24:19 +01:00
* fixed alignment of tfiledef (same as corresponding file recorddef)
* cap set alignment to sizeof(aint) git-svn-id: trunk@40442 -
This commit is contained in:
parent
b84e02b0a9
commit
95d79296bd
@ -43,7 +43,7 @@ type
|
|||||||
{$endif Test_Double_checksum}
|
{$endif Test_Double_checksum}
|
||||||
|
|
||||||
const
|
const
|
||||||
CurrentPPUVersion = 204;
|
CurrentPPUVersion = 205;
|
||||||
|
|
||||||
{ unit flags }
|
{ unit flags }
|
||||||
uf_init = $000001; { unit has initialization section }
|
uf_init = $000001; { unit has initialization section }
|
||||||
|
|||||||
@ -158,6 +158,7 @@ interface
|
|||||||
function getmangledparaname:TSymStr;override;
|
function getmangledparaname:TSymStr;override;
|
||||||
function size:asizeint;override;
|
function size:asizeint;override;
|
||||||
procedure setsize;
|
procedure setsize;
|
||||||
|
function alignment: shortint; override;
|
||||||
end;
|
end;
|
||||||
tfiledefclass = class of tfiledef;
|
tfiledefclass = class of tfiledef;
|
||||||
|
|
||||||
@ -956,6 +957,7 @@ interface
|
|||||||
procedure deref;override;
|
procedure deref;override;
|
||||||
function GetTypeName:string;override;
|
function GetTypeName:string;override;
|
||||||
function is_publishable : boolean;override;
|
function is_publishable : boolean;override;
|
||||||
|
function alignment: shortint; override;
|
||||||
end;
|
end;
|
||||||
tsetdefclass = class of tsetdef;
|
tsetdefclass = class of tsetdef;
|
||||||
|
|
||||||
@ -3212,6 +3214,20 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function tfiledef.alignment: shortint;
|
||||||
|
begin
|
||||||
|
case filetyp of
|
||||||
|
ft_text:
|
||||||
|
result:=search_system_type('TEXTREC').typedef.alignment;
|
||||||
|
ft_typed,
|
||||||
|
ft_untyped:
|
||||||
|
result:=search_system_type('FILEREC').typedef.alignment;
|
||||||
|
else
|
||||||
|
internalerror(2018120101);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure tfiledef.ppuwrite(ppufile:tcompilerppufile);
|
procedure tfiledef.ppuwrite(ppufile:tcompilerppufile);
|
||||||
begin
|
begin
|
||||||
inherited ppuwrite(ppufile);
|
inherited ppuwrite(ppufile);
|
||||||
@ -3665,6 +3681,13 @@ implementation
|
|||||||
is_publishable:=savesize in [1,2,4];
|
is_publishable:=savesize in [1,2,4];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function tsetdef.alignment: shortint;
|
||||||
|
begin
|
||||||
|
Result:=inherited;
|
||||||
|
if result>sizeof(aint) then
|
||||||
|
result:=sizeof(aint);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function tsetdef.GetTypeName : string;
|
function tsetdef.GetTypeName : string;
|
||||||
begin
|
begin
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user