$NetBSD: patch-ad,v 1.7 2015/01/19 12:42:37 wiz Exp $

Add support for BSD uuid library.
https://bugzilla.gnome.org/show_bug.cgi?id=743072

--- libgupnp/gupnp-service.c.orig	2015-01-04 11:58:24.000000000 +0000
+++ libgupnp/gupnp-service.c
@@ -46,8 +46,12 @@
 #ifdef G_OS_WIN32
 #include <rpc.h>
 #else
+#if defined(__NetBSD__) || defined(__DragonFly__) || defined(__FreeBSD__)
+#include <uuid.h>
+#else
 #include <uuid/uuid.h>
 #endif
+#endif
 
 #define SUBSCRIPTION_TIMEOUT 300 /* DLNA (7.2.22.1) enforced */
 
@@ -1110,9 +1114,19 @@ generate_sid (void)
 #else
         uuid_t id;
         char out[39];
-
+#if defined(__NetBSD__) || defined(__DragonFly__) || defined(__FreeBSD__)
+        {
+	        char *myout;
+
+	        uuid_create (&id, 0);
+	        uuid_to_string (&id, &myout, 0);
+	        strncpy (out, myout, sizeof(out));
+	        free (myout);
+        }
+#else
         uuid_generate (id);
         uuid_unparse (id, out);
+#endif
 
         return g_strdup_printf ("uuid:%s", out);
 #endif
