diff --git a/compiler/scandir.pas b/compiler/scandir.pas index 367301d439..5fbf397824 100644 --- a/compiler/scandir.pas +++ b/compiler/scandir.pas @@ -36,7 +36,7 @@ implementation verbose,comphook,ppu, scanner,switches, fmodule, - symtable, + symconst,symtable, rabase; const @@ -788,9 +788,9 @@ implementation if not(c in ['0'..'9']) then begin hs:=current_scanner.readid; - { C has the special recordalignmax of -1 } + { C has the special recordalignmax of C_alignment } if (hs='C') then - aktpackrecords:=-1 + aktpackrecords:=C_alignment else if (hs='NORMAL') or (hs='DEFAULT') then aktpackrecords:=0 diff --git a/compiler/symconst.pas b/compiler/symconst.pas index b9f599fe22..d531a5f8d7 100644 --- a/compiler/symconst.pas +++ b/compiler/symconst.pas @@ -30,6 +30,8 @@ uses const def_alignment = 4; + C_alignment = -1; + { if you change one of the following contants, } { you have also to change the typinfo unit} { and the rtl/i386,template/rttip.inc files } diff --git a/compiler/symtable.pas b/compiler/symtable.pas index d51153d420..71079762a7 100644 --- a/compiler/symtable.pas +++ b/compiler/symtable.pas @@ -82,7 +82,7 @@ interface tabstractrecordsymtable = class(tstoredsymtable) public datasize : aint; - usefieldalignment, { alignment to use for fields (PACKRECORDS value), -1 is C style } + usefieldalignment, { alignment to use for fields (PACKRECORDS value), C_alignment is C style } recordalignment, { alignment required when inserting this record } fieldalignment, { alignment current alignment used when fields are inserted } padalignment : shortint; { size to a multiple of which the symtable has to be rounded up } @@ -821,9 +821,9 @@ implementation recordalignment:=1; usefieldalignment:=usealign; padalignment:=1; - { recordalign -1 means C record packing, that starts + { recordalign C_alignment means C record packing, that starts with an alignment of 1 } - if usealign=-1 then + if usealign=C_alignment then fieldalignment:=1 else fieldalignment:=usealign; @@ -918,7 +918,7 @@ implementation vardef:=sym.vartype.def; varalign:=vardef.alignment; { Calc the alignment size for C style records } - if (usefieldalignment=-1) then + if (usefieldalignment=C_alignment) then begin if (varalign>4) and ((varalign mod 4)<>0) and @@ -956,7 +956,7 @@ implementation else datasize:=sym.fieldoffset+l; { Calc alignment needed for this record } - if (usefieldalignment=-1) then + if (usefieldalignment=C_alignment) then varalignrecord:=used_align(varalign,aktalignment.recordalignmin,aktalignment.maxCrecordalign) else if (usefieldalignment=0) then @@ -984,7 +984,7 @@ implementation use the fieldalignment, because that is updated with the used alignment. } if (padalignment = 1) then - if usefieldalignment=-1 then + if usefieldalignment=C_alignment then padalignment:=fieldalignment else padalignment:=recordalignment;