50 lines
1.3 KiB
Plaintext
50 lines
1.3 KiB
Plaintext
$NetBSD: patch-ad,v 1.8 2015/01/25 07:43:13 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,27 @@ generate_sid (void)
|
|
#else
|
|
uuid_t id;
|
|
char out[39];
|
|
-
|
|
+#if defined(__NetBSD__) || defined(__DragonFly__) || defined(__FreeBSD__)
|
|
+ {
|
|
+ char *myout = NULL;
|
|
+ uint32_t status;
|
|
+
|
|
+ uuid_create (&id, &status);
|
|
+ if (status != uuid_s_ok) {
|
|
+ return NULL;
|
|
+ }
|
|
+ uuid_to_string (&id, &myout, &status);
|
|
+ if (status != uuid_s_ok) {
|
|
+ free (myout);
|
|
+ return NULL;
|
|
+ }
|
|
+ strncpy (out, myout, sizeof(out));
|
|
+ free (myout);
|
|
+ }
|
|
+#else
|
|
uuid_generate (id);
|
|
uuid_unparse (id, out);
|
|
+#endif
|
|
|
|
return g_strdup_printf ("uuid:%s", out);
|
|
#endif
|