glib/giochannel.h Remove bogus (Win32-only) declaration of

2003-06-05  Tor Lillqvist  <tml@iki.fi>

	* glib/giochannel.h
	* glib/gmain.h: Remove bogus (Win32-only) declaration of
	g_main_poll_win32_msg_add(). No such function exists.

	* glib/gmain.c (g_poll) [Win32]: Use g_win32_error_message() for
	better warning messages.
This commit is contained in:
Tor Lillqvist 2003-06-05 22:18:27 +00:00 committed by Tor Lillqvist
parent 99c0940b78
commit 1cf610e216
9 changed files with 85 additions and 25 deletions

View File

@ -1,3 +1,12 @@
2003-06-05 Tor Lillqvist <tml@iki.fi>
* glib/giochannel.h
* glib/gmain.h: Remove bogus (Win32-only) declaration of
g_main_poll_win32_msg_add(). No such function exists.
* glib/gmain.c (g_poll) [Win32]: Use g_win32_error_message() for
better warning messages.
2003-06-04 Noah Levitt <nlevitt@columbia.edu>
* glib/gunidecomp.h (combine): Fix typo (#114375). Also, make the

View File

@ -1,3 +1,12 @@
2003-06-05 Tor Lillqvist <tml@iki.fi>
* glib/giochannel.h
* glib/gmain.h: Remove bogus (Win32-only) declaration of
g_main_poll_win32_msg_add(). No such function exists.
* glib/gmain.c (g_poll) [Win32]: Use g_win32_error_message() for
better warning messages.
2003-06-04 Noah Levitt <nlevitt@columbia.edu>
* glib/gunidecomp.h (combine): Fix typo (#114375). Also, make the

View File

@ -1,3 +1,12 @@
2003-06-05 Tor Lillqvist <tml@iki.fi>
* glib/giochannel.h
* glib/gmain.h: Remove bogus (Win32-only) declaration of
g_main_poll_win32_msg_add(). No such function exists.
* glib/gmain.c (g_poll) [Win32]: Use g_win32_error_message() for
better warning messages.
2003-06-04 Noah Levitt <nlevitt@columbia.edu>
* glib/gunidecomp.h (combine): Fix typo (#114375). Also, make the

View File

@ -1,3 +1,12 @@
2003-06-05 Tor Lillqvist <tml@iki.fi>
* glib/giochannel.h
* glib/gmain.h: Remove bogus (Win32-only) declaration of
g_main_poll_win32_msg_add(). No such function exists.
* glib/gmain.c (g_poll) [Win32]: Use g_win32_error_message() for
better warning messages.
2003-06-04 Noah Levitt <nlevitt@columbia.edu>
* glib/gunidecomp.h (combine): Fix typo (#114375). Also, make the

View File

@ -1,3 +1,12 @@
2003-06-05 Tor Lillqvist <tml@iki.fi>
* glib/giochannel.h
* glib/gmain.h: Remove bogus (Win32-only) declaration of
g_main_poll_win32_msg_add(). No such function exists.
* glib/gmain.c (g_poll) [Win32]: Use g_win32_error_message() for
better warning messages.
2003-06-04 Noah Levitt <nlevitt@columbia.edu>
* glib/gunidecomp.h (combine): Fix typo (#114375). Also, make the

View File

@ -1,3 +1,12 @@
2003-06-05 Tor Lillqvist <tml@iki.fi>
* glib/giochannel.h
* glib/gmain.h: Remove bogus (Win32-only) declaration of
g_main_poll_win32_msg_add(). No such function exists.
* glib/gmain.c (g_poll) [Win32]: Use g_win32_error_message() for
better warning messages.
2003-06-04 Noah Levitt <nlevitt@columbia.edu>
* glib/gunidecomp.h (combine): Fix typo (#114375). Also, make the

View File

@ -296,6 +296,10 @@ GLIB_VAR GSourceFuncs g_io_watch_funcs;
#ifdef G_OS_WIN32
/* You can use this "pseudo file descriptor" in a GPollFD to add
* polling for Windows messages. GTK applications should not do that.
*/
#define G_WIN32_MSG_HANDLE 19981206
/* Use this to get a GPollFD from a GIOChannel, so that you can call
@ -315,13 +319,6 @@ gint g_io_channel_win32_poll (GPollFD *fds,
gint n_fds,
gint timeout_);
/* This is used to add polling for Windows messages. GDK (GTk+) programs
* should *not* use this.
*/
void g_main_poll_win32_msg_add (gint priority,
GPollFD *fd,
guint hwnd);
/* Create an IO channel for Windows messages for window handle hwnd. */
GIOChannel *g_io_channel_win32_new_messages (guint hwnd);

View File

@ -307,7 +307,11 @@ g_poll (GPollFD *fds,
g_print ("WaitMessage\n");
#endif
if (!WaitMessage ())
g_warning (G_STRLOC ": WaitMessage() failed");
{
gchar *emsg = g_win32_error_message (GetLastError ());
g_warning (G_STRLOC ": WaitMessage() failed: %s", emsg);
g_free (emsg);
}
ready = WAIT_OBJECT_0 + nhandles;
}
else if (timeout == 0)
@ -326,7 +330,9 @@ g_poll (GPollFD *fds,
timer = SetTimer (NULL, 0, timeout, NULL);
if (timer == 0)
{
g_warning (G_STRLOC ": SetTimer() failed");
gchar *emsg = g_win32_error_message (GetLastError ());
g_warning (G_STRLOC ": SetTimer() failed: %s", emsg);
g_free (emsg);
ready = WAIT_TIMEOUT;
}
else
@ -359,7 +365,11 @@ g_poll (GPollFD *fds,
timeout, QS_ALLINPUT);
if (ready == WAIT_FAILED)
g_warning (G_STRLOC ": MsgWaitForMultipleObjects() failed");
{
gchar *emsg = g_win32_error_message (GetLastError ());
g_warning (G_STRLOC ": MsgWaitForMultipleObjects() failed: %s", emsg);
g_free (emsg);
}
}
}
}
@ -378,7 +388,11 @@ g_poll (GPollFD *fds,
#endif
ready = WaitForMultipleObjects (nhandles, handles, FALSE, timeout);
if (ready == WAIT_FAILED)
g_warning (G_STRLOC ": WaitForMultipleObjects() failed");
{
gchar *emsg = g_win32_error_message (GetLastError ());
g_warning (G_STRLOC ": WaitForMultipleObjects() failed: %s", emsg);
g_free (emsg);
}
}
#ifdef G_MAIN_POLL_DEBUG
@ -2595,8 +2609,14 @@ g_main_context_poll (GMainContext *context,
UNLOCK_CONTEXT (context);
if ((*poll_func) (fds, n_fds, timeout) < 0 && errno != EINTR)
g_warning ("poll(2) failed due to: %s.",
g_strerror (errno));
{
#ifndef G_OS_WIN32
g_warning ("poll(2) failed due to: %s.",
g_strerror (errno));
#else
/* If g_poll () returns -1, it has already called g_warning() */
#endif
}
#ifdef G_MAIN_POLL_DEBUG
LOCK_CONTEXT (context);

View File

@ -100,8 +100,7 @@ struct _GSourceFuncs
* WSAEventSelect to signal events when a SOCKET is readable).
*
* On Win32, fd can also be the special value G_WIN32_MSG_HANDLE to
* indicate polling for messages. These message queue GPollFDs should
* be added with the g_main_poll_win32_msg_add function.
* indicate polling for messages.
*
* But note that G_WIN32_MSG_HANDLE GPollFDs should not be used by GDK
* (GTK) programs, as GDK itself wants to read messages and convert them
@ -300,16 +299,6 @@ gboolean g_idle_remove_by_data (gpointer data);
GLIB_VAR GSourceFuncs g_timeout_funcs;
GLIB_VAR GSourceFuncs g_idle_funcs;
#ifdef G_OS_WIN32
/* This is used to add polling for Windows messages. GDK (GTK+) programs
* should *not* use this.
*/
void g_main_poll_win32_msg_add (gint priority,
GPollFD *fd,
guint hwnd);
#endif /* G_OS_WIN32 */
G_END_DECLS
#endif /* __G_MAIN_H__ */