diff options
author | Tor Lillqvist <tml@iki.fi> | 2000-12-14 21:02:20 +0000 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 2000-12-14 21:02:20 +0000 |
commit | b74e7d2f4780c159f7583bd4eecd07ee222d1d9c (patch) | |
tree | a798d4c358afea2d19ff034eddf229c550c257aa /gmain.c | |
parent | b0baf3db03355028f7c7eabdef9bcfa7f4e08eaf (diff) |
Warn if no callback. Call callback correctly. (g_io_win32_create_watch):
2000-12-14 Tor Lillqvist <tml@iki.fi>
* giowin32.c (g_io_win32_dispatch): Warn if no callback. Call
callback correctly.
(g_io_win32_create_watch): Fix typo.
(g_io_win32_fd_create_watch): Ditto.
(g_io_channel_unix_new): If it is a file descriptor (i.e., a Unix
fd lookalike provided by the C library), call
g_io_channel_win32_new_fd(). If it is a socket (from WinSock),
call g_io_cahnnel_win32_new_stream_socket(). Hopefully sockets and
fds don't overlap. TODO: Implement also datagram sockets.
(g_io_channel_win32_poll): Call g_main_context_get_poll_func().
* gcompletion.h: Include <unistd.h> only on Unix. Is this
inclusion really needed here? OTOH, do include <stddef.h>, for
size_t.
* gmessages.c: (Win32) Don't define a function called "write" that
might clash with the prototype from <io.h>, use a #define.
* glib.def: Update.
* gmain.c (g_source_add_poll): Don't return a value from void
function.
(g_main_context_get_poll_func): Compile also for non-Win32, as
presumably was intended. The result var is a GPollFunc, not a
GPollFunc*. Return the result!
gobject:
2000-12-14 Tor Lillqvist <tml@iki.fi>
* makefile.mingw.in: Update, include parts from Makefile.am to
build gmarshal.[ch]. Some day, we won't need these separate
makefiles for Win32 compilation. I hope.
* makefile.msc.in: Update. No use trying to build gmarshal.[ch]
here, it would require Unixish tools. MSVC users building from CVS
sources are out of luck.
* gobject.def: Update.
Diffstat (limited to 'gmain.c')
-rw-r--r-- | gmain.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -904,7 +904,7 @@ g_source_add_poll (GSource *source, g_return_if_fail (source != NULL); g_return_if_fail (fd != NULL); - g_return_val_if_fail (!SOURCE_DESTROYED (source), 0); + g_return_if_fail (!SOURCE_DESTROYED (source)); context = source->context; @@ -2440,8 +2440,6 @@ g_main_context_set_poll_func (GMainContext *context, UNLOCK_CONTEXT (context); } -#ifdef G_OS_WIN32 - /** * g_main_context_get_poll_func: * @context: a #GMainContext @@ -2453,7 +2451,7 @@ g_main_context_set_poll_func (GMainContext *context, GPollFunc g_main_context_get_poll_func (GMainContext *context) { - GPollFunc *result; + GPollFunc result; if (!context) context = g_main_context_default (); @@ -2461,9 +2459,9 @@ g_main_context_get_poll_func (GMainContext *context) LOCK_CONTEXT (context); result = context->poll_func; UNLOCK_CONTEXT (context); -} -#endif + return result; +} /* HOLDS: context's lock */ /* Wake the main loop up from a poll() */ @@ -2477,7 +2475,7 @@ g_main_context_wakeup (GMainContext *context) #ifndef G_OS_WIN32 write (context->wake_up_pipe[1], "A", 1); #else - ReleaseSemaphore (context->context->wake_up_semaphore, 1, NULL); + ReleaseSemaphore (context->wake_up_semaphore, 1, NULL); #endif } #endif |