From ea635bfda5d8254ccc2f9f5e66bb6e651fe40786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A1roly=20Balogh?= Date: Sat, 24 Jun 2017 23:18:12 +0000 Subject: [PATCH] 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 - --- rtl/objpas/typinfo.pp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rtl/objpas/typinfo.pp b/rtl/objpas/typinfo.pp index 88f7942004..2a06964341 100644 --- a/rtl/objpas/typinfo.pp +++ b/rtl/objpas/typinfo.pp @@ -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}