Pārlūkot izejas kodu

* Removed "packed" attribute from TUC_Prop on alignment-sensitive targets (temporary solution, see comment in source), and from TUCA_DataBook on all targets (does not add noticeable bloat because this type is used just a few times. OTOH having unaligned pointers in record hurts performance on all targets).

This change fixes fpwidestring-related tests at least on mips-linux.

git-svn-id: trunk@29322 -
sergei 10 gadi atpakaļ
vecāks
revīzija
38068acd42
1 mainītis faili ar 7 papildinājumiem un 2 dzēšanām
  1. 7 2
      rtl/objpas/unicodedata.pas

+ 7 - 2
rtl/objpas/unicodedata.pas

@@ -207,7 +207,12 @@ type
 
   { TUC_Prop }
 
-  TUC_Prop = packed record
+  { On alignment-sensitive targets, at least some of them, assembler uses to forcibly align data >1 byte.
+    This breaks intended layout of initialized constants/variables.
+    A proper solution is to patch compiler to emit always unaligned directives for words/dwords/etc,
+    but for now just declare this record as "unpacked". This causes bloat, but it's better than having
+    entire unit not working at all. }
+  TUC_Prop = {$ifndef FPC_REQUIRES_PROPER_ALIGNMENT}packed{$endif} record
   private
     function GetCategory : Byte;inline;
     procedure SetCategory(AValue : Byte);
@@ -322,7 +327,7 @@ type
   TCollationName = string[128];
 
   PUCA_DataBook = ^TUCA_DataBook;
-  TUCA_DataBook = packed record
+  TUCA_DataBook = record
   public
     Base               : PUCA_DataBook;
     Version            : TCollationName;