Commit f248c86b authored by Dan Winship's avatar Dan Winship

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
parent 731b4699
......@@ -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;
}
......@@ -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
;
}
......
......@@ -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)
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment