From a804fcba7aef64a1476a5d5133826ed986bf15ec Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Sat, 7 Oct 2017 10:44:28 +0800 Subject: [PATCH] gio: Fix gio-tool-open.c on Windows/Cocoa Commit 7384e37 broke builds on these platforms as *NIX-only APIs are being used unconditionally. Fix the build by building these portions when not on Windows or Cocoa. https://bugzilla.gnome.org/show_bug.cgi?id=780296 --- gio/gio-tool-open.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gio/gio-tool-open.c b/gio/gio-tool-open.c index 742880e35..9f06f4e99 100644 --- a/gio/gio-tool-open.c +++ b/gio/gio-tool-open.c @@ -20,7 +20,11 @@ #include "config.h" #include + +#if defined(G_OS_UNIX) && !defined(HAVE_COCOA) #include +#endif + #include #include "gio-tool.h" @@ -30,6 +34,7 @@ static const GOptionEntry entries[] = { { NULL } }; +#if defined(G_OS_UNIX) && !defined(HAVE_COCOA) static gboolean get_bus_name_and_path_from_uri (const char *uri, char **bus_name_out, @@ -90,6 +95,7 @@ out: return got_name; } +#endif int handle_open (int argc, char *argv[], gboolean do_help) @@ -154,6 +160,7 @@ handle_open (int argc, char *argv[], gboolean do_help) success = FALSE; } +#if defined(G_OS_UNIX) && !defined(HAVE_COCOA) /* FIXME: This chunk of madness is a workaround for a dbus-daemon bug. * See https://bugzilla.gnome.org/show_bug.cgi?id=780296 */ @@ -180,6 +187,7 @@ handle_open (int argc, char *argv[], gboolean do_help) g_free (object_path); } } +#endif g_object_unref (file); g_free (uri);