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
This commit is contained in:
Dan Winship 2012-11-11 11:32:40 -05:00
parent 731b469908
commit f248c86b0a
4 changed files with 16 additions and 7 deletions

View File

@ -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;
}

View File

@ -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
;
}

View File

@ -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)

View File

@ -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