mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 17:49:27 +02:00
typinfo: push/pop doesn't save packrecords. also, always use AlignTypeData on m68k, which might have less than pointer sized (word, 2 byte) alignments in the typeinfo, because on most systems C compilers also use 2 byte alignments, so we need that for compatibility
git-svn-id: trunk@36594 -
This commit is contained in:
parent
41f72a0e6d
commit
ea635bfda5
@ -790,11 +790,15 @@ type
|
||||
|
||||
function aligntoptr(p : pointer) : pointer;inline;
|
||||
begin
|
||||
{$ifdef m68k}
|
||||
result:=AlignTypeData(p);
|
||||
{$else m68k}
|
||||
{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
|
||||
result:=align(p,sizeof(p));
|
||||
{$else FPC_REQUIRES_PROPER_ALIGNMENT}
|
||||
result:=p;
|
||||
{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
|
||||
{$endif m68k}
|
||||
end;
|
||||
|
||||
|
||||
@ -1007,14 +1011,13 @@ end;
|
||||
|
||||
|
||||
Function AlignTypeData(p : Pointer) : Pointer;
|
||||
{$push}
|
||||
{$packrecords c}
|
||||
type
|
||||
TAlignCheck = record
|
||||
b : byte;
|
||||
q : qword;
|
||||
end;
|
||||
{$pop}
|
||||
{$packrecords default}
|
||||
begin
|
||||
{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
|
||||
{$ifdef VER3_0}
|
||||
|
Loading…
Reference in New Issue
Block a user