[glib] win32: move some code into #ifdef G_OS_UNIX



commit f248c86b0aac6c64bd2cb8e2a0e8814719a4bb0a
Author: Dan Winship <danw gnome org>
Date:   Sun Nov 11 11:32:40 2012 -0500

    win32: move some code into #ifdef G_OS_UNIX
    
    Fix various bits of code/declarations that are only used by G_OS_UNIX
    but were still visible to G_OS_WIN32.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=688109

 gio/gdbusmessage.c           |    2 ++
 gio/gdbusprivate.c           |    8 +++++++-
 gio/glocaldirectorymonitor.c |   11 ++++++-----
 gio/tests/Makefile.am        |    2 +-
 4 files changed, 16 insertions(+), 7 deletions(-)
---
diff --git a/gio/gdbusmessage.c b/gio/gdbusmessage.c
index 65e459a..ab68898 100644
--- a/gio/gdbusmessage.c
+++ b/gio/gdbusmessage.c
@@ -3275,6 +3275,8 @@ g_dbus_message_copy (GDBusMessage  *message,
   while (g_hash_table_iter_next (&iter, &header_key, (gpointer) &header_value))
     g_hash_table_insert (ret->headers, header_key, g_variant_ref (header_value));
 
+#ifdef G_OS_UNIX
  out:
+#endif
   return ret;
 }
diff --git a/gio/gdbusprivate.c b/gio/gdbusprivate.c
index 58df523..cda0b07 100644
--- a/gio/gdbusprivate.c
+++ b/gio/gdbusprivate.c
@@ -963,6 +963,7 @@ write_message_async_cb (GObject      *source_object,
  * write-lock is not held on entry
  * output_pending is PENDING_WRITE on entry
  */
+#ifdef G_OS_UNIX
 static gboolean
 on_socket_ready (GSocket      *socket,
                  GIOCondition  condition,
@@ -972,6 +973,7 @@ on_socket_ready (GSocket      *socket,
   write_message_continue_writing (data);
   return FALSE; /* remove source */
 }
+#endif
 
 /* called in private thread shared by all GDBusConnection instances
  *
@@ -982,15 +984,17 @@ static void
 write_message_continue_writing (MessageToWriteData *data)
 {
   GOutputStream *ostream;
-  GSimpleAsyncResult *simple;
 #ifdef G_OS_UNIX
+  GSimpleAsyncResult *simple;
   GUnixFDList *fd_list;
 #endif
 
+#ifdef G_OS_UNIX
   /* Note: we can't access data->simple after calling g_async_result_complete () because the
    * callback can free @data and we're not completing in idle. So use a copy of the pointer.
    */
   simple = data->simple;
+#endif
 
   ostream = g_io_stream_get_output_stream (data->worker->stream);
 #ifdef G_OS_UNIX
@@ -1106,7 +1110,9 @@ write_message_continue_writing (MessageToWriteData *data)
                                    write_message_async_cb,
                                    data);
     }
+#ifdef G_OS_UNIX
  out:
+#endif
   ;
 }
 
diff --git a/gio/glocaldirectorymonitor.c b/gio/glocaldirectorymonitor.c
index 0266dc0..c5e7088 100644
--- a/gio/glocaldirectorymonitor.c
+++ b/gio/glocaldirectorymonitor.c
@@ -193,22 +193,23 @@ mounts_changed (GUnixMountMonitor *mount_monitor,
                 gpointer           user_data)
 {
   GLocalDirectoryMonitor *local_monitor = user_data;
+#ifdef G_OS_UNIX
   GUnixMountEntry *mount;
+#endif
   gboolean is_mounted;
   GFile *file;
   
   /* Emulate unmount detection */
-#ifdef G_OS_WIN32
-  mount = NULL;
-  /*claim everything was mounted */
-  is_mounted = TRUE;
-#else  
+#ifdef G_OS_UNIX
   mount = g_unix_mount_at (local_monitor->dirname, NULL);
   
   is_mounted = mount != NULL;
   
   if (mount)
     g_unix_mount_free (mount);
+#else
+  /*claim everything was mounted */
+  is_mounted = TRUE;
 #endif
 
   if (local_monitor->was_mounted != is_mounted)
diff --git a/gio/tests/Makefile.am b/gio/tests/Makefile.am
index fb419a0..a87ef05 100644
--- a/gio/tests/Makefile.am
+++ b/gio/tests/Makefile.am
@@ -117,7 +117,6 @@ SAMPLE_PROGS = 				\
 	gdbus-example-peer		\
 	gdbus-example-proxy-subclass	\
 	gdbus-connection-flush-helper	\
-	appinfo-test			\
 	proxy				\
 	gapplication-example-open	\
 	gapplication-example-cmdline	\
@@ -142,6 +141,7 @@ SAMPLE_PROGS +=					\
 	gdbus-example-unix-fd-client 		\
 	gdbus-example-objectmanager-server 	\
 	gdbus-example-objectmanager-client 	\
+	appinfo-test				\
 	$(NULL)
 endif
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]