$NetBSD: patch-ad,v 1.5 2013/04/10 11:15:45 wiz Exp $

Add support for BSD uuid library.

--- libgupnp/gupnp-service.c.orig	2013-02-20 12:35:57.000000000 +0000
+++ libgupnp/gupnp-service.c
@@ -44,8 +44,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 */
 
@@ -1100,9 +1104,19 @@ generate_sid (void)
 #else
         uuid_t id;
         char out[39];
+#if defined(__NetBSD__) || defined(__DragonFly__) || defined(__FreeBSD__)
+	char *myout;
+#endif
 
+#if defined(__NetBSD__) || defined(__DragonFly__) || defined(__FreeBSD__)
+	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
