update Thu Apr 15 00:37:00 PDT 2010
[pkgsrc.git] / wip / ibus-pinyin / patches / patch-ae
1 $NetBSD$
2
3 --- src/Util.h.orig     2010-04-08 07:03:07.000000000 +0000
4 +++ src/Util.h
5 @@ -1,7 +1,17 @@
6  #ifndef __PY_UTIL_H_
7  #define __PY_UTIL_H_
8  
9 +#ifdef HAVE_CONFIG_H
10 +#include "config.h"
11 +#endif
12 +
13 +#if defined(HAVE_UUID_H)
14 +#include <uuid.h>
15 +#elif defined(HAVE_UUID_UUID_H)
16  #include <uuid/uuid.h>
17 +#elif defined(HAVE_SYS_UUID_H)
18 +#include <sys/uuid.h>
19 +#endif
20  #include <sys/utsname.h>
21  #include <stdlib.h>
22  #include "String.h"
23 @@ -12,8 +22,16 @@ class UUID {
24  public:
25      UUID (void) {
26          uuid_t u;
27 +#if defined(HAVE_UUID_CREATE)
28 +        gchar* uuid;
29 +        uuid_create (&u, 0);
30 +        uuid_to_string (&u, &uuid, 0);
31 +        strncpy (m_uuid, uuid, sizeof(m_uuid));
32 +        free(uuid);
33 +#elif defined(HAVE_UUID_GENERATE)
34          uuid_generate (u);
35          uuid_unparse (u, m_uuid);
36 +#endif
37      }
38  
39      operator const gchar * (void) const {