diff options
author | Ryan Lortie <desrt@desrt.ca> | 2014-02-13 17:07:07 -0500 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2014-02-15 16:57:12 -0500 |
commit | 7d35099efd661f46d17bdc651319029e49ef0891 (patch) | |
tree | 11f0310b73575e9f958b01a344f473a1c061613f | |
parent | 89cb3239ef0954b75d558fd634f003fef83afb9f (diff) | |
download | glib-7d35099efd661f46d17bdc651319029e49ef0891.tar.gz |
gsocket: use check/prepare only on win32
There is no longer any code left in the check/prepare functions on UNIX,
so put %NULL in the GSourceFuncs vtable.
-rw-r--r-- | gio/gsocket.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/gio/gsocket.c b/gio/gsocket.c index 5a09aeb14..baa6c8a1f 100644 --- a/gio/gsocket.c +++ b/gio/gsocket.c @@ -3213,31 +3213,31 @@ typedef struct { GIOCondition condition; } GSocketSource; +#ifdef G_OS_WIN32 static gboolean -socket_source_prepare (GSource *source, - gint *timeout) +socket_source_prepare_win32 (GSource *source, + gint *timeout) { GSocketSource *socket_source = (GSocketSource *)source; *timeout = -1; -#ifdef G_OS_WIN32 socket_source->pollfd.revents = update_condition (socket_source->socket); if ((socket_source->condition & socket_source->pollfd.revents) != 0) return TRUE; -#endif return FALSE; } static gboolean -socket_source_check (GSource *source) +socket_source_check_win32 (GSource *source) { int timeout; - return socket_source_prepare (source, &timeout); + return socket_source_prepare_win32 (source, &timeout); } +#endif static gboolean socket_source_dispatch (GSource *source, @@ -3319,8 +3319,12 @@ socket_source_closure_callback (GSocket *socket, static GSourceFuncs socket_source_funcs = { - socket_source_prepare, - socket_source_check, +#ifdef G_OS_WIN32 + socket_source_prepare_win32, + socket_source_check_win32, +#else + NULL, NULL, /* check, prepare */ +#endif socket_source_dispatch, socket_source_finalize, (GSourceFunc)socket_source_closure_callback, |