Sfoglia il codice sorgente

* fix writing of enums for 64 bit platforms that do not require proper alignment

git-svn-id: trunk@10742 -
tom_at_work 17 anni fa
parent
commit
33bba100fc
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. 4 0
      rtl/inc/text.inc

+ 4 - 0
rtl/inc/text.inc

@@ -754,7 +754,11 @@ begin
           dec(ordinal,minvalue);
           dec(ordinal,minvalue);
         end;
         end;
       {Get the address of the string.}
       {Get the address of the string.}
+{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}      
       p:=Pshortstring((PPpointer(ord2strindex+align(sizeof(longint), sizeof(ptrint)))+ordinal)^);
       p:=Pshortstring((PPpointer(ord2strindex+align(sizeof(longint), sizeof(ptrint)))+ordinal)^);
+{$else}
+      p:=Pshortstring((PPpointer(ord2strindex+sizeof(longint))+ordinal)^);
+{$endif}
       if p=nil then
       if p=nil then
         begin
         begin
           inoutres:=107;      {Invalid ordinal value for this enum.}
           inoutres:=107;      {Invalid ordinal value for this enum.}