diff --git a/ChangeLog b/ChangeLog index 38ae06380..8714e9c9e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-09-25 Tor Lillqvist + + Bug 553820 - gpoll.c: undeclared identifier + + * glib/gmain.c + * glib/gpoll.c: Make the g_poll() function non-static also on + Windows. Prefix an underscore to the g_main_poll_debug variable + and make it non-static in gmain.c so that it can be used in + gpoll.c. Add back missing variable declaration. + 2008-09-25 Tor Lillqvist * glib/gspawn-win32.c (do_spawn_with_pipes) (do_spawn_directly): diff --git a/glib/gmain.c b/glib/gmain.c index 42f7828e3..d7ff0f5cb 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -109,7 +109,7 @@ struct _GMainDispatch }; #ifdef G_MAIN_POLL_DEBUG -static gboolean g_main_poll_debug = FALSE; +gboolean _g_main_poll_debug = FALSE; #endif struct _GMainContext @@ -421,7 +421,7 @@ g_main_context_init_pipe (GMainContext *context) context->wake_up_rec.fd = (gintptr) context->wake_up_semaphore; context->wake_up_rec.events = G_IO_IN; - if (g_main_poll_debug) + if (_g_main_poll_debug) g_print ("wake-up semaphore: %p\n", context->wake_up_semaphore); # endif g_main_context_add_poll_unlocked (context, 0, &context->wake_up_rec); @@ -460,7 +460,7 @@ g_main_context_new (void) if (!beenhere) { if (getenv ("G_MAIN_POLL_DEBUG") != NULL) - g_main_poll_debug = TRUE; + _g_main_poll_debug = TRUE; beenhere = TRUE; } } @@ -507,7 +507,7 @@ g_main_context_new (void) main_context_list = g_slist_append (main_context_list, context); #ifdef G_MAIN_POLL_DEBUG - if (g_main_poll_debug) + if (_g_main_poll_debug) g_print ("created context=%p\n", context); #endif @@ -536,7 +536,7 @@ g_main_context_default (void) { default_main_context = g_main_context_new (); #ifdef G_MAIN_POLL_DEBUG - if (g_main_poll_debug) + if (_g_main_poll_debug) g_print ("default context=%p\n", default_main_context); #endif } @@ -2745,7 +2745,7 @@ g_main_context_poll (GMainContext *context, if (n_fds || timeout != 0) { #ifdef G_MAIN_POLL_DEBUG - if (g_main_poll_debug) + if (_g_main_poll_debug) { g_print ("polling context=%p n=%d timeout=%d\n", context, n_fds, timeout); @@ -2769,7 +2769,7 @@ g_main_context_poll (GMainContext *context, } #ifdef G_MAIN_POLL_DEBUG - if (g_main_poll_debug) + if (_g_main_poll_debug) { LOCK_CONTEXT (context); diff --git a/glib/gpoll.c b/glib/gpoll.c index 0fc2d9ee3..30e5429d0 100644 --- a/glib/gpoll.c +++ b/glib/gpoll.c @@ -80,7 +80,7 @@ #include "galias.h" #ifdef G_MAIN_POLL_DEBUG -extern gboolean g_main_poll_debug; +extern gboolean _g_main_poll_debug; #endif #ifdef HAVE_POLL @@ -148,7 +148,7 @@ poll_rest (gboolean poll_msgs, /* Wait for either messages or handles * -> Use MsgWaitForMultipleObjectsEx */ - if (g_main_poll_debug) + if (_g_main_poll_debug) g_print (" MsgWaitForMultipleObjectsEx(%d, %d)\n", nhandles, timeout); ready = MsgWaitForMultipleObjectsEx (nhandles, handles, timeout, @@ -177,7 +177,7 @@ poll_rest (gboolean poll_msgs, /* Wait for just handles * -> Use WaitForMultipleObjectsEx */ - if (g_main_poll_debug) + if (_g_main_poll_debug) g_print (" WaitForMultipleObjectsEx(%d, %d)\n", nhandles, timeout); ready = WaitForMultipleObjectsEx (nhandles, handles, FALSE, timeout, TRUE); @@ -189,7 +189,7 @@ poll_rest (gboolean poll_msgs, } } - if (g_main_poll_debug) + if (_g_main_poll_debug) g_print (" wait returns %ld%s\n", ready, (ready == WAIT_FAILED ? " (WAIT_FAILED)" : @@ -226,7 +226,7 @@ poll_rest (gboolean poll_msgs, if ((HANDLE) f->fd == handles[ready - WAIT_OBJECT_0]) { f->revents = f->events; - if (g_main_poll_debug) + if (_g_main_poll_debug) g_print (" got event %p\n", (HANDLE) f->fd); } } @@ -237,6 +237,7 @@ poll_rest (gboolean poll_msgs, if (timeout == 0 && nhandles > 1) { /* Remove the handle that fired */ + int i; if (ready < nhandles - 1) for (i = ready - WAIT_OBJECT_0 + 1; i < nhandles; i++) handles[i-1] = handles[i]; @@ -250,8 +251,7 @@ poll_rest (gboolean poll_msgs, return 0; } - -static gint +gint g_poll (GPollFD *fds, guint nfds, gint timeout) @@ -262,13 +262,13 @@ g_poll (GPollFD *fds, gint nhandles = 0; int retval; - if (g_main_poll_debug) + if (_g_main_poll_debug) g_print ("g_poll: waiting for"); for (f = fds; f < &fds[nfds]; ++f) if (f->fd == G_WIN32_MSG_HANDLE && (f->events & G_IO_IN)) { - if (g_main_poll_debug && !poll_msgs) + if (_g_main_poll_debug && !poll_msgs) g_print (" MSG"); poll_msgs = TRUE; } @@ -293,14 +293,14 @@ g_poll (GPollFD *fds, } else { - if (g_main_poll_debug) + if (_g_main_poll_debug) g_print (" %p", (HANDLE) f->fd); handles[nhandles++] = (HANDLE) f->fd; } } } - if (g_main_poll_debug) + if (_g_main_poll_debug) g_print ("\n"); for (f = fds; f < &fds[nfds]; ++f)