glib r7542 - in trunk: . glib
- From: tml svn gnome org
- To: svn-commits-list gnome org
- Subject: glib r7542 - in trunk: . glib
- Date: Thu, 25 Sep 2008 19:59:49 +0000 (UTC)
Author: tml
Date: Thu Sep 25 19:59:49 2008
New Revision: 7542
URL: http://svn.gnome.org/viewvc/glib?rev=7542&view=rev
Log:
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.
Modified:
trunk/ChangeLog
trunk/glib/gmain.c
trunk/glib/gpoll.c
Modified: trunk/glib/gmain.c
==============================================================================
--- trunk/glib/gmain.c (original)
+++ trunk/glib/gmain.c Thu Sep 25 19:59:49 2008
@@ -109,7 +109,7 @@
};
#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 @@
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 @@
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 @@
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 @@
{
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 @@
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 @@
}
#ifdef G_MAIN_POLL_DEBUG
- if (g_main_poll_debug)
+ if (_g_main_poll_debug)
{
LOCK_CONTEXT (context);
Modified: trunk/glib/gpoll.c
==============================================================================
--- trunk/glib/gpoll.c (original)
+++ trunk/glib/gpoll.c Thu Sep 25 19:59:49 2008
@@ -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 @@
/* 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 @@
/* 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 @@
}
}
- 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 @@
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 @@
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 @@
return 0;
}
-
-static gint
+gint
g_poll (GPollFD *fds,
guint nfds,
gint timeout)
@@ -262,13 +262,13 @@
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 @@
}
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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]