mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-09 18:54:04 +02:00
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:
@@ -3275,6 +3275,8 @@ g_dbus_message_copy (GDBusMessage *message,
|
|||||||
while (g_hash_table_iter_next (&iter, &header_key, (gpointer) &header_value))
|
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));
|
g_hash_table_insert (ret->headers, header_key, g_variant_ref (header_value));
|
||||||
|
|
||||||
|
#ifdef G_OS_UNIX
|
||||||
out:
|
out:
|
||||||
|
#endif
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@@ -963,6 +963,7 @@ write_message_async_cb (GObject *source_object,
|
|||||||
* write-lock is not held on entry
|
* write-lock is not held on entry
|
||||||
* output_pending is PENDING_WRITE on entry
|
* output_pending is PENDING_WRITE on entry
|
||||||
*/
|
*/
|
||||||
|
#ifdef G_OS_UNIX
|
||||||
static gboolean
|
static gboolean
|
||||||
on_socket_ready (GSocket *socket,
|
on_socket_ready (GSocket *socket,
|
||||||
GIOCondition condition,
|
GIOCondition condition,
|
||||||
@@ -972,6 +973,7 @@ on_socket_ready (GSocket *socket,
|
|||||||
write_message_continue_writing (data);
|
write_message_continue_writing (data);
|
||||||
return FALSE; /* remove source */
|
return FALSE; /* remove source */
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* called in private thread shared by all GDBusConnection instances
|
/* called in private thread shared by all GDBusConnection instances
|
||||||
*
|
*
|
||||||
@@ -982,15 +984,17 @@ static void
|
|||||||
write_message_continue_writing (MessageToWriteData *data)
|
write_message_continue_writing (MessageToWriteData *data)
|
||||||
{
|
{
|
||||||
GOutputStream *ostream;
|
GOutputStream *ostream;
|
||||||
GSimpleAsyncResult *simple;
|
|
||||||
#ifdef G_OS_UNIX
|
#ifdef G_OS_UNIX
|
||||||
|
GSimpleAsyncResult *simple;
|
||||||
GUnixFDList *fd_list;
|
GUnixFDList *fd_list;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef G_OS_UNIX
|
||||||
/* Note: we can't access data->simple after calling g_async_result_complete () because the
|
/* 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.
|
* callback can free @data and we're not completing in idle. So use a copy of the pointer.
|
||||||
*/
|
*/
|
||||||
simple = data->simple;
|
simple = data->simple;
|
||||||
|
#endif
|
||||||
|
|
||||||
ostream = g_io_stream_get_output_stream (data->worker->stream);
|
ostream = g_io_stream_get_output_stream (data->worker->stream);
|
||||||
#ifdef G_OS_UNIX
|
#ifdef G_OS_UNIX
|
||||||
@@ -1106,7 +1110,9 @@ write_message_continue_writing (MessageToWriteData *data)
|
|||||||
write_message_async_cb,
|
write_message_async_cb,
|
||||||
data);
|
data);
|
||||||
}
|
}
|
||||||
|
#ifdef G_OS_UNIX
|
||||||
out:
|
out:
|
||||||
|
#endif
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -193,22 +193,23 @@ mounts_changed (GUnixMountMonitor *mount_monitor,
|
|||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GLocalDirectoryMonitor *local_monitor = user_data;
|
GLocalDirectoryMonitor *local_monitor = user_data;
|
||||||
|
#ifdef G_OS_UNIX
|
||||||
GUnixMountEntry *mount;
|
GUnixMountEntry *mount;
|
||||||
|
#endif
|
||||||
gboolean is_mounted;
|
gboolean is_mounted;
|
||||||
GFile *file;
|
GFile *file;
|
||||||
|
|
||||||
/* Emulate unmount detection */
|
/* Emulate unmount detection */
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_UNIX
|
||||||
mount = NULL;
|
|
||||||
/*claim everything was mounted */
|
|
||||||
is_mounted = TRUE;
|
|
||||||
#else
|
|
||||||
mount = g_unix_mount_at (local_monitor->dirname, NULL);
|
mount = g_unix_mount_at (local_monitor->dirname, NULL);
|
||||||
|
|
||||||
is_mounted = mount != NULL;
|
is_mounted = mount != NULL;
|
||||||
|
|
||||||
if (mount)
|
if (mount)
|
||||||
g_unix_mount_free (mount);
|
g_unix_mount_free (mount);
|
||||||
|
#else
|
||||||
|
/*claim everything was mounted */
|
||||||
|
is_mounted = TRUE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (local_monitor->was_mounted != is_mounted)
|
if (local_monitor->was_mounted != is_mounted)
|
||||||
|
@@ -117,7 +117,6 @@ SAMPLE_PROGS = \
|
|||||||
gdbus-example-peer \
|
gdbus-example-peer \
|
||||||
gdbus-example-proxy-subclass \
|
gdbus-example-proxy-subclass \
|
||||||
gdbus-connection-flush-helper \
|
gdbus-connection-flush-helper \
|
||||||
appinfo-test \
|
|
||||||
proxy \
|
proxy \
|
||||||
gapplication-example-open \
|
gapplication-example-open \
|
||||||
gapplication-example-cmdline \
|
gapplication-example-cmdline \
|
||||||
@@ -142,6 +141,7 @@ SAMPLE_PROGS += \
|
|||||||
gdbus-example-unix-fd-client \
|
gdbus-example-unix-fd-client \
|
||||||
gdbus-example-objectmanager-server \
|
gdbus-example-objectmanager-server \
|
||||||
gdbus-example-objectmanager-client \
|
gdbus-example-objectmanager-client \
|
||||||
|
appinfo-test \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user