From 8ca952c41f705d04d7352f46e7217e932abbfd7b Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Mon, 23 Jan 2012 22:23:39 +0400 Subject: [PATCH] Prevent 'unused var' warnings and adjust ABORT message in GC_DllMain * win32_threads.c (GC_DllMain): Do not declare "sb" and "sb_result" local variables if unused. * win32_threads (GC_DllMain): Remove redundant test for THREAD_LOCAL_ALLOC (since it is always off if GC_NO_THREADS_DISCOVERY); adjust ABORT message (for DLL_PROCESS_ATTACH case if PARALLEL_MARK). --- win32_threads.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/win32_threads.c b/win32_threads.c index 66ae019e..a6329ead 100644 --- a/win32_threads.c +++ b/win32_threads.c @@ -2592,11 +2592,7 @@ GC_INNER void GC_thr_init(void) BOOL WINAPI GC_DllMain(HINSTANCE inst GC_ATTR_UNUSED, ULONG reason, LPVOID reserved GC_ATTR_UNUSED) { - struct GC_stack_base sb; DWORD thread_id; -# ifdef GC_ASSERTIONS - int sb_result; -# endif static int entry_count = 0; if (!GC_win32_dll_threads && parallel_initialized) return TRUE; @@ -2616,14 +2612,15 @@ GC_INNER void GC_thr_init(void) /* This may run with the collector uninitialized. */ thread_id = GetCurrentThreadId(); if (parallel_initialized && GC_main_thread != thread_id) { -# if defined(THREAD_LOCAL_ALLOC) || defined(PARALLEL_MARK) - ABORT("Cannot initialize thread local cache from DllMain"); +# ifdef PARALLEL_MARK + ABORT("Cannot initialize parallel marker from DllMain"); # else + struct GC_stack_base sb; /* Don't lock here. */ # ifdef GC_ASSERTIONS - sb_result = + int sb_result = # endif - GC_get_stack_base(&sb); + GC_get_stack_base(&sb); GC_ASSERT(sb_result == GC_SUCCESS); GC_register_my_thread_inner(&sb, thread_id); # endif -- 2.40.0