Bug 553820 - gpoll.c: undeclared identifier

2008-09-25  Tor Lillqvist  <tml@novell.com>

	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.


svn path=/trunk/; revision=7542
This commit is contained in:
Tor Lillqvist 2008-09-25 19:59:49 +00:00 committed by Tor Lillqvist
parent efce76ce67
commit fc542a462a
3 changed files with 28 additions and 18 deletions

View File

@ -1,3 +1,13 @@
2008-09-25 Tor Lillqvist <tml@novell.com>
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 <tml@novell.com> 2008-09-25 Tor Lillqvist <tml@novell.com>
* glib/gspawn-win32.c (do_spawn_with_pipes) (do_spawn_directly): * glib/gspawn-win32.c (do_spawn_with_pipes) (do_spawn_directly):

View File

@ -109,7 +109,7 @@ struct _GMainDispatch
}; };
#ifdef G_MAIN_POLL_DEBUG #ifdef G_MAIN_POLL_DEBUG
static gboolean g_main_poll_debug = FALSE; gboolean _g_main_poll_debug = FALSE;
#endif #endif
struct _GMainContext 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.fd = (gintptr) context->wake_up_semaphore;
context->wake_up_rec.events = G_IO_IN; 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); g_print ("wake-up semaphore: %p\n", context->wake_up_semaphore);
# endif # endif
g_main_context_add_poll_unlocked (context, 0, &context->wake_up_rec); g_main_context_add_poll_unlocked (context, 0, &context->wake_up_rec);
@ -460,7 +460,7 @@ g_main_context_new (void)
if (!beenhere) if (!beenhere)
{ {
if (getenv ("G_MAIN_POLL_DEBUG") != NULL) if (getenv ("G_MAIN_POLL_DEBUG") != NULL)
g_main_poll_debug = TRUE; _g_main_poll_debug = TRUE;
beenhere = TRUE; beenhere = TRUE;
} }
} }
@ -507,7 +507,7 @@ g_main_context_new (void)
main_context_list = g_slist_append (main_context_list, context); main_context_list = g_slist_append (main_context_list, context);
#ifdef G_MAIN_POLL_DEBUG #ifdef G_MAIN_POLL_DEBUG
if (g_main_poll_debug) if (_g_main_poll_debug)
g_print ("created context=%p\n", context); g_print ("created context=%p\n", context);
#endif #endif
@ -536,7 +536,7 @@ g_main_context_default (void)
{ {
default_main_context = g_main_context_new (); default_main_context = g_main_context_new ();
#ifdef G_MAIN_POLL_DEBUG #ifdef G_MAIN_POLL_DEBUG
if (g_main_poll_debug) if (_g_main_poll_debug)
g_print ("default context=%p\n", default_main_context); g_print ("default context=%p\n", default_main_context);
#endif #endif
} }
@ -2745,7 +2745,7 @@ g_main_context_poll (GMainContext *context,
if (n_fds || timeout != 0) if (n_fds || timeout != 0)
{ {
#ifdef G_MAIN_POLL_DEBUG #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", g_print ("polling context=%p n=%d timeout=%d\n",
context, n_fds, timeout); context, n_fds, timeout);
@ -2769,7 +2769,7 @@ g_main_context_poll (GMainContext *context,
} }
#ifdef G_MAIN_POLL_DEBUG #ifdef G_MAIN_POLL_DEBUG
if (g_main_poll_debug) if (_g_main_poll_debug)
{ {
LOCK_CONTEXT (context); LOCK_CONTEXT (context);

View File

@ -80,7 +80,7 @@
#include "galias.h" #include "galias.h"
#ifdef G_MAIN_POLL_DEBUG #ifdef G_MAIN_POLL_DEBUG
extern gboolean g_main_poll_debug; extern gboolean _g_main_poll_debug;
#endif #endif
#ifdef HAVE_POLL #ifdef HAVE_POLL
@ -148,7 +148,7 @@ poll_rest (gboolean poll_msgs,
/* Wait for either messages or handles /* Wait for either messages or handles
* -> Use MsgWaitForMultipleObjectsEx * -> Use MsgWaitForMultipleObjectsEx
*/ */
if (g_main_poll_debug) if (_g_main_poll_debug)
g_print (" MsgWaitForMultipleObjectsEx(%d, %d)\n", nhandles, timeout); g_print (" MsgWaitForMultipleObjectsEx(%d, %d)\n", nhandles, timeout);
ready = MsgWaitForMultipleObjectsEx (nhandles, handles, timeout, ready = MsgWaitForMultipleObjectsEx (nhandles, handles, timeout,
@ -177,7 +177,7 @@ poll_rest (gboolean poll_msgs,
/* Wait for just handles /* Wait for just handles
* -> Use WaitForMultipleObjectsEx * -> Use WaitForMultipleObjectsEx
*/ */
if (g_main_poll_debug) if (_g_main_poll_debug)
g_print (" WaitForMultipleObjectsEx(%d, %d)\n", nhandles, timeout); g_print (" WaitForMultipleObjectsEx(%d, %d)\n", nhandles, timeout);
ready = WaitForMultipleObjectsEx (nhandles, handles, FALSE, timeout, TRUE); 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", g_print (" wait returns %ld%s\n",
ready, ready,
(ready == WAIT_FAILED ? " (WAIT_FAILED)" : (ready == WAIT_FAILED ? " (WAIT_FAILED)" :
@ -226,7 +226,7 @@ poll_rest (gboolean poll_msgs,
if ((HANDLE) f->fd == handles[ready - WAIT_OBJECT_0]) if ((HANDLE) f->fd == handles[ready - WAIT_OBJECT_0])
{ {
f->revents = f->events; f->revents = f->events;
if (g_main_poll_debug) if (_g_main_poll_debug)
g_print (" got event %p\n", (HANDLE) f->fd); g_print (" got event %p\n", (HANDLE) f->fd);
} }
} }
@ -237,6 +237,7 @@ poll_rest (gboolean poll_msgs,
if (timeout == 0 && nhandles > 1) if (timeout == 0 && nhandles > 1)
{ {
/* Remove the handle that fired */ /* Remove the handle that fired */
int i;
if (ready < nhandles - 1) if (ready < nhandles - 1)
for (i = ready - WAIT_OBJECT_0 + 1; i < nhandles; i++) for (i = ready - WAIT_OBJECT_0 + 1; i < nhandles; i++)
handles[i-1] = handles[i]; handles[i-1] = handles[i];
@ -250,8 +251,7 @@ poll_rest (gboolean poll_msgs,
return 0; return 0;
} }
gint
static gint
g_poll (GPollFD *fds, g_poll (GPollFD *fds,
guint nfds, guint nfds,
gint timeout) gint timeout)
@ -262,13 +262,13 @@ g_poll (GPollFD *fds,
gint nhandles = 0; gint nhandles = 0;
int retval; int retval;
if (g_main_poll_debug) if (_g_main_poll_debug)
g_print ("g_poll: waiting for"); g_print ("g_poll: waiting for");
for (f = fds; f < &fds[nfds]; ++f) for (f = fds; f < &fds[nfds]; ++f)
if (f->fd == G_WIN32_MSG_HANDLE && (f->events & G_IO_IN)) 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"); g_print (" MSG");
poll_msgs = TRUE; poll_msgs = TRUE;
} }
@ -293,14 +293,14 @@ g_poll (GPollFD *fds,
} }
else else
{ {
if (g_main_poll_debug) if (_g_main_poll_debug)
g_print (" %p", (HANDLE) f->fd); g_print (" %p", (HANDLE) f->fd);
handles[nhandles++] = (HANDLE) f->fd; handles[nhandles++] = (HANDLE) f->fd;
} }
} }
} }
if (g_main_poll_debug) if (_g_main_poll_debug)
g_print ("\n"); g_print ("\n");
for (f = fds; f < &fds[nfds]; ++f) for (f = fds; f < &fds[nfds]; ++f)