From 875854411a4ea5fdd1d9217d7856858d89090cb9 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Tue, 19 Jun 2012 12:04:28 +0800 Subject: [PATCH] Bug 678332-GIO: Fix build on Windows/non-GCC -gconverterinputstream.c: Avoid GCCism by not using non-standard pointer arithmetic on void*, but do a cast to char * as that seems to be what the variable was used for. -gtestdbus.c: Don't include unistd.h unconditionally, and use g_usleep() instead of usleep(), as usleep() is not universally available. --- gio/gconverterinputstream.c | 2 +- gio/gtestdbus.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gio/gconverterinputstream.c b/gio/gconverterinputstream.c index 76ccc0a..1684635 100644 --- a/gio/gconverterinputstream.c +++ b/gio/gconverterinputstream.c @@ -415,7 +415,7 @@ read_internal (GInputStream *stream, buffer_read (&priv->converted_buffer, buffer, available); total_bytes_read = available; - buffer += available; + (char *) buffer += available; count -= available; /* If there is no data to convert, and no pre-converted data, diff --git a/gio/gtestdbus.c b/gio/gtestdbus.c index 6b9fdd3..171a4fe 100644 --- a/gio/gtestdbus.c +++ b/gio/gtestdbus.c @@ -26,7 +26,9 @@ #include #include +#ifdef HAVE_UNISTD_H #include +#endif #include @@ -560,7 +562,7 @@ start_daemon (GTestDBus *self) g_spawn_command_line_async (command, NULL); g_free (command); - usleep (500 * 1000); + g_usleep (500 * 1000); } /* Cleanup */ -- 2.7.4