Przeglądaj źródła

Windows TLS callback code testable by using -dTEST_TLS_DIRECTORY

git-svn-id: trunk@17906 -
pierre 14 lat temu
rodzic
commit
4ad2707674
2 zmienionych plików z 10 dodań i 4 usunięć
  1. 6 0
      compiler/options.pas
  2. 4 4
      compiler/symsym.pas

+ 6 - 0
compiler/options.pas

@@ -2853,6 +2853,12 @@ if (target_info.system=system_arm_darwin) then
         def_system_macro('FPC_HAS_TYPE_EXTENDED');
 {$endif}
     end;
+    { Not ready yet }
+{$ifdef TEST_TLS_DIRECTORY}
+    if target_info.system in systems_windows then
+      def_system_macro('FPC_USE_TLS_DIRECTORY');
+{$endif TEST_TLS_DIRECTORY}
+
 
 {$ifdef ARM}
   { define FPC_DOUBLE_HILO_SWAPPED if needed to properly handle doubles in RTL }

+ 4 - 4
compiler/symsym.pas

@@ -1366,17 +1366,17 @@ implementation
 
 
     procedure tstaticvarsym.set_mangledname(const s:string);
-{$ifdef FPC_USE_TLS_DIRECTORY}
+{$ifdef TEST_TLS_DIRECTORY}
      { TLS directory requires some labels in specific sections
        I implemented this by allowing '.section sec_name mangled_name'
        for name 'xxxx'; specifier PM 2011-07-01 }
       var
         newmangledname : string;
         p : longint;
-{$endif FPC_USE_TLS_DIRECTORY}
+{$endif TEST_TLS_DIRECTORY}
       begin
         stringdispose(_mangledname);
-{$ifdef FPC_USE_TLS_DIRECTORY}
+{$ifdef TEST_TLS_DIRECTORY}
         if copy(s,1,length('.section '))='.section ' then
            begin
              newmangledname:=copy(s,length('.section ')+1,length(s));
@@ -1392,7 +1392,7 @@ implementation
                end;
            end
          else
-{$endif FPC_USE_TLS_DIRECTORY}
+{$endif TEST_TLS_DIRECTORY}
       {$ifdef compress}
         _mangledname:=stringdup(minilzw_encode(s));
       {$else}