From 9a9e2b5d7d452c10f517bf0e8e15bde3f3b08258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 19 Jan 2022 21:01:10 +0400 Subject: [PATCH] gio: enable unix: address on win32 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau --- gio/gdbusaddress.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/gio/gdbusaddress.c b/gio/gdbusaddress.c index 8a4e2b1de..48fdef2f4 100644 --- a/gio/gdbusaddress.c +++ b/gio/gdbusaddress.c @@ -40,12 +40,12 @@ #include "gdbusprivate.h" #include "gstdio.h" -#ifdef G_OS_UNIX +#ifdef HAVE_UNISTD_H #include +#endif #include #include #include -#endif #ifdef G_OS_WIN32 #include @@ -66,6 +66,9 @@ * * TCP D-Bus connections are supported, but accessing them via a proxy is * currently not supported. + * + * Since GLib 2.72, `unix:` addresses are supported on Windows with `AF_UNIX` + * support (Windows 10). */ static gchar *get_session_address_platform_specific (GError **error); @@ -571,11 +574,7 @@ g_dbus_address_connect (const gchar *address_entry, ret = NULL; nonce_file = NULL; - if (FALSE) - { - } -#ifdef G_OS_UNIX - else if (g_strcmp0 (transport_name, "unix") == 0) + if (g_strcmp0 (transport_name, "unix") == 0) { const gchar *path; const gchar *abstract; @@ -605,7 +604,6 @@ g_dbus_address_connect (const gchar *address_entry, g_assert_not_reached (); } } -#endif else if (g_strcmp0 (transport_name, "tcp") == 0 || g_strcmp0 (transport_name, "nonce-tcp") == 0) { const gchar *s;