diff options
author | Jens Georg <mail@jensge.org> | 2015-06-14 14:06:13 +0200 |
---|---|---|
committer | Jens Georg <mail@jensge.org> | 2015-06-14 14:06:13 +0200 |
commit | 899118659c76e692df1f90b981e5faac485c1eb6 (patch) | |
tree | 6a9d5415d757519edba1fa43cb2e3bde918befa7 | |
parent | de0d3e726e0bc16ce22a6fa543c8c23b903779c2 (diff) | |
download | gupnp-tools-899118659c76e692df1f90b981e5faac485c1eb6.tar.gz |
network-light: Use UUID function from GUPnP
Signed-off-by: Jens Georg <mail@jensge.org>
-rw-r--r-- | configure.ac | 7 | ||||
-rw-r--r-- | src/network-light/upnp.c | 25 |
2 files changed, 6 insertions, 26 deletions
diff --git a/configure.ac b/configure.ac index 4c87a8f..1fcfa9b 100644 --- a/configure.ac +++ b/configure.ac @@ -30,7 +30,7 @@ LT_INIT([]) GLIB_REQUIRED=2.24 GSSDP_REQUIRED=0.13.3 -GUPNP_REQUIRED=0.20.8 +GUPNP_REQUIRED=0.20.14 SOUP_REQUIRED=2.4 GUPNP_AV_REQUIRED=0.5.5 GTK_REQUIRED=3.10 @@ -64,11 +64,8 @@ PKG_CHECK_MODULES(GTKSOURCEVIEW, gtksourceview-3.0 >= $GTKSOURCEVIEW_REQUIRED, AC_SUBST([TEXT_VIEW],[GtkSourceView]), AC_SUBST([TEXT_VIEW],[GtkTextView])) -if test "x$os_win32" = "xno"; then - PKG_CHECK_MODULES(UUID, uuid) -else +if test "x$os_win32" = "xyes"; then AC_CHECK_TOOL(WINDRES, windres) - AC_SUBST([UUID_LIBS], ["-lrpcrt4"]) fi AC_ARG_WITH( av, diff --git a/src/network-light/upnp.c b/src/network-light/upnp.c index f1c93bf..ca55de6 100644 --- a/src/network-light/upnp.c +++ b/src/network-light/upnp.c @@ -26,12 +26,6 @@ #include <locale.h> #include <string.h> #include <gmodule.h> -#ifndef G_OS_WIN32 -#include <uuid/uuid.h> -#else -#include <rpc.h> -typedef UUID uuid_t; -#endif #include <glib/gstdio.h> #include "gui.h" @@ -59,7 +53,7 @@ static GList *dimming_proxies; static GUPnPXMLDoc *doc; static char *desc_location; -static char uuid[37]; +static char *uuid; void on_get_status (GUPnPService *service, @@ -386,23 +380,10 @@ xml_util_get_element (xmlNode *node, static void init_uuid (void) { - uuid_t uuid_context; xmlNode *uuid_node; char *udn; -#ifndef G_OS_WIN32 - uuid_generate (uuid_context); - uuid_unparse (uuid_context, uuid); -#else - { - gchar *tmp_uuid; - UuidCreate(&uuid_context); - UuidToString(&uuid_context, &tmp_uuid); - memcpy(uuid, tmp_uuid, 36); - RpcStringFree(&tmp_uuid); - } -#endif - + uuid = gupnp_get_uuid (); uuid_node = xml_util_get_element ((xmlNode *) doc->doc, "root", "device", @@ -778,5 +759,7 @@ deinit_upnp (void) if (g_remove (desc_location) != 0) g_warning ("error removing %s\n", desc_location); g_free (desc_location); + g_free (uuid); + uuid = NULL; } |