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>
+
* glib/gspawn-win32.c (do_spawn_with_pipes) (do_spawn_directly):
Just ignore the child_setup function, never call it. The is no
situation in which it could be useful on Windows. Do print a
};
#ifdef G_MAIN_POLL_DEBUG
-static gboolean g_main_poll_debug = FALSE;
+gboolean _g_main_poll_debug = FALSE;
#endif
struct _GMainContext
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);
if (!beenhere)
{
if (getenv ("G_MAIN_POLL_DEBUG") != NULL)
- g_main_poll_debug = TRUE;
+ _g_main_poll_debug = TRUE;
beenhere = TRUE;
}
}
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
{
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
}
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);
}
#ifdef G_MAIN_POLL_DEBUG
- if (g_main_poll_debug)
+ if (_g_main_poll_debug)
{
LOCK_CONTEXT (context);
#include "galias.h"
#ifdef G_MAIN_POLL_DEBUG
-extern gboolean g_main_poll_debug;
+extern gboolean _g_main_poll_debug;
#endif
#ifdef HAVE_POLL
/* 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,
/* 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);
}
}
- if (g_main_poll_debug)
+ if (_g_main_poll_debug)
g_print (" wait returns %ld%s\n",
ready,
(ready == WAIT_FAILED ? " (WAIT_FAILED)" :
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);
}
}
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];
return 0;
}
-
-static gint
+gint
g_poll (GPollFD *fds,
guint nfds,
gint timeout)
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;
}
}
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)