Fix compilation for winpthreads if HANDLE_FORK
authorIvan Maidanski <ivmai@mail.ru>
Sat, 17 Dec 2016 07:11:37 +0000 (10:11 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Sat, 17 Dec 2016 07:11:37 +0000 (10:11 +0300)
* tests/test.c [GC_PTHREADS && !GC_WIN32_PTHREADS]
(NO_TEST_HANDLE_FORK): Define.
* win32_threads.c [CAN_HANDLE_FORK] (available_markers_m1): Define (as
static variable) even if !GC_PTHREADS_PARAMARK.

tests/test.c
win32_threads.c

index f5f04ef..ef70aef 100644 (file)
@@ -84,7 +84,7 @@
 #   define GC_printf printf
 # endif
 
-# if defined(GC_PTHREADS)
+# if defined(GC_PTHREADS) && !defined(GC_WIN32_PTHREADS)
 #   include <pthread.h>
 # else
 #   define NO_TEST_HANDLE_FORK
index 5ff3c63..1527ba3 100644 (file)
@@ -1766,7 +1766,9 @@ GC_INNER void GC_get_next_stack(char *start, char *limit,
 
   /* GC_mark_threads[] is unused here unlike that in pthread_support.c  */
 
-# ifndef CAN_HANDLE_FORK
+# ifdef CAN_HANDLE_FORK
+    static int available_markers_m1 = 0;
+# else
 #   define available_markers_m1 GC_markers_m1
 # endif
 
@@ -1780,9 +1782,6 @@ GC_INNER void GC_get_next_stack(char *start, char *limit,
 
     /* GC_start_mark_threads is the same as in pthread_support.c except */
     /* for thread stack that is assumed to be large enough.             */
-#   ifdef CAN_HANDLE_FORK
-      static int available_markers_m1 = 0;
-#   endif
 
     GC_INNER void GC_start_mark_threads_inner(void)
     {