summaryrefslogtreecommitdiff
path: root/net/gupnp/patches/patch-ad
blob: cf100a4ae7899899e31e881703880a5fc9860e49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
$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