Commit 2c6c0329 authored by Chun-wei Fan's avatar Chun-wei Fan

gio: Fix gio-tool-open.c on Windows/Cocoa

Commit 7384e372 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
parent 7e70dd88
......@@ -20,7 +20,11 @@
#include "config.h"
#include <gio/gio.h>
#if defined(G_OS_UNIX) && !defined(HAVE_COCOA)
#include <gio/gdesktopappinfo.h>
#endif
#include <gi18n.h>
#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);
......
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