summaryrefslogtreecommitdiff
path: root/net/gupnp-tools/patches/patch-aa
blob: 0d6d41c149ead5482c3618bb2e7bc51520997b9c (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
$NetBSD: patch-aa,v 1.3 2010/02/16 15:30:50 wiz Exp $

--- src/network-light/upnp.c.orig	2009-08-26 14:54:42.000000000 +0000
+++ src/network-light/upnp.c
@@ -25,7 +25,11 @@
 #include <stdio.h>
 #include <locale.h>
 #include <string.h>
+#if defined(__NetBSD__) || defined(__DragonFly__)
+#include <uuid.h>
+#else
 #include <uuid/uuid.h>
+#endif
 #include <glib/gstdio.h>
 
 #include "gui.h"
@@ -317,9 +321,19 @@ static void init_uuid ()
         uuid_t uuid_context;
         xmlNode *uuid_node;
         char *udn;
-
+#if defined(__NetBSD__) || defined(__DragonFly__)
+	char *myuuidstr;
+#endif
+
+#if defined(__NetBSD__) || defined(__DragonFly__)
+        uuid_create(&uuid_context, 0);
+        uuid_to_string(&uuid_context, &myuuidstr, 0);
+        strncpy(uuid, myuuidstr, sizeof(uuid));
+        free(myuuidstr);
+#else
         uuid_generate (uuid_context);
         uuid_unparse (uuid_context, uuid);
+#endif
 
         uuid_node = xml_util_get_element ((xmlNode *) doc->doc,
                                           "root",