mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 14:09:17 +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;
|
function aligntoptr(p : pointer) : pointer;inline;
|
||||||
begin
|
begin
|
||||||
|
{$ifdef m68k}
|
||||||
|
result:=AlignTypeData(p);
|
||||||
|
{$else m68k}
|
||||||
{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
|
{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
|
||||||
result:=align(p,sizeof(p));
|
result:=align(p,sizeof(p));
|
||||||
{$else FPC_REQUIRES_PROPER_ALIGNMENT}
|
{$else FPC_REQUIRES_PROPER_ALIGNMENT}
|
||||||
result:=p;
|
result:=p;
|
||||||
{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
|
{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
|
||||||
|
{$endif m68k}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -1007,14 +1011,13 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
Function AlignTypeData(p : Pointer) : Pointer;
|
Function AlignTypeData(p : Pointer) : Pointer;
|
||||||
{$push}
|
|
||||||
{$packrecords c}
|
{$packrecords c}
|
||||||
type
|
type
|
||||||
TAlignCheck = record
|
TAlignCheck = record
|
||||||
b : byte;
|
b : byte;
|
||||||
q : qword;
|
q : qword;
|
||||||
end;
|
end;
|
||||||
{$pop}
|
{$packrecords default}
|
||||||
begin
|
begin
|
||||||
{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
|
{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
|
||||||
{$ifdef VER3_0}
|
{$ifdef VER3_0}
|
||||||
|
Loading…
Reference in New Issue
Block a user