Sfoglia il codice sorgente

+ introduce AlignToPtr, a copy of the one from the TypInfo unit (we should really come up with a better name here considering that it's redirecting to AlignTypeData on m68k...)

git-svn-id: trunk@42803 -
svenbarth 6 anni fa
parent
commit
dad9260f93
1 ha cambiato i file con 13 aggiunte e 0 eliminazioni
  1. 13 0
      packages/rtl-objpas/src/inc/rtti.pp

+ 13 - 0
packages/rtl-objpas/src/inc/rtti.pp

@@ -615,6 +615,19 @@ uses
 {$endif}
   fgl;
 
+function AlignToPtr(aPtr: Pointer): Pointer; inline;
+begin
+{$ifdef CPUM68K}
+  Result := AlignTypeData(aPtr);
+{$else}
+{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
+  Result := Align(aPtr, SizeOf(Pointer));
+{$else}
+  Result := aPtr;
+{$endif}
+{$endif}
+end;
+
 type
 
   { TRttiPool }