gthread.c: Declare variable at start of block

This is so that C89 compilers will not complain.
This commit is contained in:
Chun-wei Fan 2011-09-23 13:37:08 +08:00
parent a485a0e565
commit 2b391940c0

View File

@ -667,6 +667,7 @@ void
g_thread_init_glib (void) g_thread_init_glib (void)
{ {
static gboolean already_done; static gboolean already_done;
GRealThread* main_thread;
if (already_done) if (already_done)
return; return;
@ -676,7 +677,7 @@ g_thread_init_glib (void)
/* We let the main thread (the one that calls g_thread_init) inherit /* We let the main thread (the one that calls g_thread_init) inherit
* the static_private data set before calling g_thread_init * the static_private data set before calling g_thread_init
*/ */
GRealThread* main_thread = (GRealThread*) g_thread_self (); main_thread = (GRealThread*) g_thread_self ();
/* setup the basic threading system */ /* setup the basic threading system */
g_threads_got_initialized = TRUE; g_threads_got_initialized = TRUE;