Browse Source

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

git-svn-id: trunk@29781 -
florian 10 years ago
parent
commit
6c99493181
1 changed files with 18 additions and 5 deletions
  1. 18 5
      packages/graph/src/win32/graph.pp

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

@@ -13,15 +13,32 @@
 
 
  **********************************************************************}
  **********************************************************************}
 unit Graph;
 unit Graph;
+
 interface
 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,
   To be able to use standard file handles in the graph thread,
   we need to use the system functions handling threads,
   we need to use the system functions handling threads,
   to ensure that thread varaibles are correctly initialized.
   to ensure that thread varaibles are correctly initialized.
   This new default setting can be overridden by defining
   This new default setting can be overridden by defining
   USE_WINDOWS_API_THREAD_FUNCTIONS macro.
   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}
 {$ifndef USE_WINDOWS_API_THREAD_FUNCTIONS}
   {$define USE_SYSTEM_BEGIN_THREAD}
   {$define USE_SYSTEM_BEGIN_THREAD}
@@ -134,10 +151,6 @@ const
 
 
 {$i graph.inc}
 {$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
 var
    savedscreen : hbitmap;
    savedscreen : hbitmap;
    graphrunning : boolean;
    graphrunning : boolean;