From: Ivan Maidanski Date: Tue, 9 Oct 2012 18:20:48 +0000 (+0400) Subject: Fix GC_CreateThread and GC_beginthreadex definition for Cygwin X-Git-Tag: gc7_4_0~202 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=36e0b481de4011e5808eb62ba3a3c12c633ec685;p=gc Fix GC_CreateThread and GC_beginthreadex definition for Cygwin * win32_threads.c (CreateThread, ExitThread, _beginthreadex, _endthreadex): Undefine unconditionally (because the original function might be used even for GC_PTHREADS targets). * win32_threads.c (GC_beginthreadex, GC_endthreadex): Do not define on Cygwin because the latter does not provide _beginthreadex and _endthreadex. --- diff --git a/win32_threads.c b/win32_threads.c index eebc0ea6..aa239b26 100644 --- a/win32_threads.c +++ b/win32_threads.c @@ -39,6 +39,11 @@ GC_INNER unsigned long GC_lock_holder = NO_THREAD; #endif +#undef CreateThread +#undef ExitThread +#undef _beginthreadex +#undef _endthreadex + #ifdef GC_PTHREADS # include /* for EAGAIN */ @@ -61,11 +66,6 @@ #else -# undef CreateThread -# undef ExitThread -# undef _beginthreadex -# undef _endthreadex - # ifdef MSWINCE /* Force DONT_USE_SIGNALANDWAIT implementation of PARALLEL_MARK */ /* for WinCE (since Win32 SignalObjectAndWait() is missing). */ @@ -2239,7 +2239,7 @@ GC_INNER void GC_get_next_stack(char *start, char *limit, ExitThread(dwExitCode); } -# ifndef MSWINCE +# if !defined(MSWINCE) && !defined(CYGWIN32) GC_API GC_uintptr_t GC_CALL GC_beginthreadex( void *security, unsigned stack_size, @@ -2293,7 +2293,7 @@ GC_INNER void GC_get_next_stack(char *start, char *limit, _endthreadex(retval); } -# endif /* !MSWINCE */ +# endif /* !MSWINCE && !CYGWIN32 */ #ifdef GC_WINMAIN_REDIRECT /* This might be useful on WinCE. Shouldn't be used with GC_DLL. */