+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
+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
+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
+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
+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
+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
#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
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);
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)
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
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);
+ }
}
}
}
#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
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);
* 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
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__ */