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



commit 2c6c03290fd2aa22666ffbdf501bc84b47c1e2db
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Sat Oct 7 10:44:28 2017 +0800

    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 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gio/gio-tool-open.c b/gio/gio-tool-open.c
index 742880e..9f06f4e 100644
--- a/gio/gio-tool-open.c
+++ b/gio/gio-tool-open.c
@@ -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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]