Jelajahi Sumber

* use USE_WINDOWS_API_THREAD_FUNCTIONS in the windows graph unit by default, resolves #27508

git-svn-id: trunk@29781 -
florian 10 tahun lalu
induk
melakukan
6c99493181
1 mengubah file dengan 18 tambahan dan 5 penghapusan
  1. 18 5
      packages/graph/src/win32/graph.pp

+ 18 - 5
packages/graph/src/win32/graph.pp

@@ -13,15 +13,32 @@
 
  **********************************************************************}
 unit Graph;
+
 interface
 
+{ used to create a file containing all calls to WM_PAINT
+  WARNING this probably creates HUGE files PM }
+{ $define DEBUG_WM_PAINT}
+
+{ debug child window handling }
+{ $define DEBUGCHILDS}
+
 {
   To be able to use standard file handles in the graph thread,
   we need to use the system functions handling threads,
   to ensure that thread varaibles are correctly initialized.
   This new default setting can be overridden by defining
   USE_WINDOWS_API_THREAD_FUNCTIONS macro.
-}
+
+  Use API thread functions by default, to avoid interferences due to
+  initialization of threadvars, this solves e.g. #27508 (which does not
+  mean though that interworking with CRT is guranteed in any way)
+
+  undefine this when debugging the graph unit due to writelns in the
+  debug code }
+{$if not(defined(DEBUG_WM_PAINT)) and not(defined(DEBUGCHILDS))}
+{$define USE_WINDOWS_API_THREAD_FUNCTIONS}
+{$endif not(defined(DEBUG_WM_PAINT)) and not(defined(DEBUGCHILDS))}
 
 {$ifndef USE_WINDOWS_API_THREAD_FUNCTIONS}
   {$define USE_SYSTEM_BEGIN_THREAD}
@@ -134,10 +151,6 @@ const
 
 {$i graph.inc}
 
-
-{ used to create a file containing all calls to WM_PAINT
-  WARNING this probably creates HUGE files PM }
-{ $define DEBUG_WM_PAINT}
 var
    savedscreen : hbitmap;
    graphrunning : boolean;