From 887dce09cabb172883395b88a31b9cfe98c0fa22 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sat, 17 Dec 2016 10:11:37 +0300 Subject: [PATCH] Fix compilation for winpthreads if HANDLE_FORK * 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 | 2 +- win32_threads.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/test.c b/tests/test.c index f5f04ef..ef70aef 100644 --- a/tests/test.c +++ b/tests/test.c @@ -84,7 +84,7 @@ # define GC_printf printf # endif -# if defined(GC_PTHREADS) +# if defined(GC_PTHREADS) && !defined(GC_WIN32_PTHREADS) # include # else # define NO_TEST_HANDLE_FORK diff --git a/win32_threads.c b/win32_threads.c index 5ff3c63..1527ba3 100644 --- a/win32_threads.c +++ b/win32_threads.c @@ -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) { -- 2.7.4