Browse Source

Fix compilation for i386 CPU with -Cg option.
This is failing since commit #39345 because FPC_PIC macro is only set after _INTERFACE is parsed.
+ Warning about this added.

git-svn-id: trunk@39374 -

pierre 7 years ago
parent
commit
1440fe7d0d
1 changed files with 12 additions and 5 deletions
  1. 12 5
      packages/rtl-generics/src/generics.hashes.pas

+ 12 - 5
packages/rtl-generics/src/generics.hashes.pas

@@ -33,6 +33,18 @@ unit Generics.Hashes;
 {$OVERFLOWCHECKS OFF}
 {$RANGECHECKS OFF}
 
+interface
+
+uses
+  Classes, SysUtils;
+
+{ Warning: the following set of macro code
+  that decides to use assembler or normal code
+  needs to stay after the _INTERFACE keyword
+  because FPC_PIC macro is only set after this keyword,
+  as it can be modified before by the global $PIC preprocessor directive. 
+  Pierre Muller 2018/07/04 }
+
 {$ifdef FPC_PIC}
   {$define DISABLE_X86_CPUINTEL}
 {$endif FPC_PIC}
@@ -64,11 +76,6 @@ unit Generics.Hashes;
   {$endif}
 {$endif CPU64}
 
-interface
-
-uses
-  Classes, SysUtils;
-
 // Original version of Bob Jenkins Hash
 // http://burtleburtle.net/bob/c/lookup3.c
 function HashWord(