[guest - Sat Apr 23 18:31:10 2005]:
Show quoted text> the datatype uuid_t is defined in /usr/include/unistd.h in OS/X 10.4
> renaming this datatype to perl_uuid_t fixes the problem
I've written a patch to fix this; it's attached.
Please apply this and rerelease soon -- the module doesn't build otherwise!
diff -u Data-UUID-0.11/UUID.h Data-UUID-0.11-new/UUID.h
--- Data-UUID-0.11/UUID.h 2003-08-27 15:38:35.000000000 -0400
+++ Data-UUID-0.11-new/UUID.h 2005-05-14 23:27:28.000000000 -0400
@@ -77,20 +77,20 @@
# define UNLOCK(f)
#endif
-#undef uuid_t
+#undef perl_uuid_t
typedef struct _uuid_node_t {
char nodeID[6];
} uuid_node_t;
-typedef struct _uuid_t {
+typedef struct _perl_uuid_t {
unsigned32 time_low;
unsigned16 time_mid;
unsigned16 time_hi_and_version;
unsigned8 clock_seq_hi_and_reserved;
unsigned8 clock_seq_low;
byte node[6];
-} uuid_t;
+} perl_uuid_t;
typedef struct _uuid_state_t {
uuid_time_t ts;
@@ -105,13 +105,13 @@
} uuid_context_t;
static void format_uuid_v1(
- uuid_t *uuid,
+ perl_uuid_t *uuid,
unsigned16 clockseq,
uuid_time_t timestamp,
uuid_node_t node
);
static void format_uuid_v3(
- uuid_t *uuid,
+ perl_uuid_t *uuid,
unsigned char hash[16]
);
static void get_current_time(uuid_time_t * timestamp);
diff -u Data-UUID-0.11/UUID.xs Data-UUID-0.11-new/UUID.xs
--- Data-UUID-0.11/UUID.xs 2003-08-27 15:38:35.000000000 -0400
+++ Data-UUID-0.11-new/UUID.xs 2005-05-14 23:29:09.000000000 -0400
@@ -3,28 +3,28 @@
#include "XSUB.h"
#include "UUID.h"
-static uuid_t NameSpace_DNS = { /* 6ba7b810-9dad-11d1-80b4-00c04fd430c8 */
+static perl_uuid_t NameSpace_DNS = { /* 6ba7b810-9dad-11d1-80b4-00c04fd430c8 */
0x6ba7b810,
0x9dad,
0x11d1,
0x80, 0xb4, { 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8 }
};
-static uuid_t NameSpace_URL = { /* 6ba7b811-9dad-11d1-80b4-00c04fd430c8 */
+static perl_uuid_t NameSpace_URL = { /* 6ba7b811-9dad-11d1-80b4-00c04fd430c8 */
0x6ba7b811,
0x9dad,
0x11d1,
0x80, 0xb4, { 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8 }
};
-static uuid_t NameSpace_OID = { /* 6ba7b812-9dad-11d1-80b4-00c04fd430c8 */
+static perl_uuid_t NameSpace_OID = { /* 6ba7b812-9dad-11d1-80b4-00c04fd430c8 */
0x6ba7b812,
0x9dad,
0x11d1,
0x80, 0xb4, { 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8 }
};
-uuid_t NameSpace_X500 = { /* 6ba7b814-9dad-11d1-80b4-00c04fd430c8 */
+perl_uuid_t NameSpace_X500 = { /* 6ba7b814-9dad-11d1-80b4-00c04fd430c8 */
0x6ba7b814,
0x9dad,
0x11d1,
@@ -32,7 +32,7 @@
};
static void format_uuid_v1(
- uuid_t *uuid,
+ perl_uuid_t *uuid,
unsigned16 clock_seq,
uuid_time_t timestamp,
uuid_node_t node
@@ -89,10 +89,10 @@
}
static void format_uuid_v3(
- uuid_t *uuid,
+ perl_uuid_t *uuid,
unsigned char hash[16]
) {
- memcpy(uuid, hash, sizeof(uuid_t));
+ memcpy(uuid, hash, sizeof(perl_uuid_t));
uuid->time_low = ntohl(uuid->time_low);
uuid->time_mid = ntohs(uuid->time_mid);
@@ -168,7 +168,7 @@
MD5Final(seed, &c);
}
-SV* make_ret(const uuid_t u, int type) {
+SV* make_ret(const perl_uuid_t u, int type) {
char buf[BUFSIZ];
unsigned char *from, *to;
STRLEN len;
@@ -177,8 +177,8 @@
memset(buf, 0x00, BUFSIZ);
switch(type) {
case F_BIN:
- memcpy(buf, (void*)&u, sizeof(uuid_t));
- len = sizeof(uuid_t);
+ memcpy(buf, (void*)&u, sizeof(perl_uuid_t));
+ len = sizeof(perl_uuid_t);
break;
case F_STR:
sprintf(buf, "%8.8X-%4.4X-%4.4X-%2.2X%2.2X-", (unsigned int)u.time_low, u.time_mid,
@@ -237,7 +237,7 @@
SV *sv
char *s = SvPV(sv, len);
PPCODE:
- pv = 0; len = sizeof(uuid_t);
+ pv = 0; len = sizeof(perl_uuid_t);
if (strEQ(s,"NameSpace_DNS"))
pv = (char*)&NameSpace_DNS;
if (strEQ(s,"NameSpace_URL"))
@@ -294,7 +294,7 @@
PREINIT:
uuid_time_t timestamp;
unsigned16 clockseq;
- uuid_t uuid;
+ perl_uuid_t uuid;
FILE *fd;
mode_t mask;
PPCODE:
@@ -327,7 +327,7 @@
void
create_from_name(self,nsid,name)
uuid_context_t *self;
- uuid_t *nsid;
+ perl_uuid_t *nsid;
char *name;
ALIAS:
Data::UUID::create_from_name_bin = F_BIN
@@ -337,8 +337,8 @@
PREINIT:
MD5_CTX c;
unsigned char hash[16];
- uuid_t net_nsid;
- uuid_t uuid;
+ perl_uuid_t net_nsid;
+ perl_uuid_t uuid;
PPCODE:
net_nsid = *nsid;
net_nsid.time_low = htonl(net_nsid.time_low);
@@ -346,7 +346,7 @@
net_nsid.time_hi_and_version = htons(net_nsid.time_hi_and_version);
MD5Init(&c);
- MD5Update(&c, (unsigned char*)&net_nsid, sizeof(uuid_t));
+ MD5Update(&c, (unsigned char*)&net_nsid, sizeof(perl_uuid_t));
MD5Update(&c, (unsigned char*)name, strlen(name));
MD5Final(hash, &c);
@@ -357,8 +357,8 @@
int
compare(self,u1,u2)
uuid_context_t *self;
- uuid_t *u1;
- uuid_t *u2;
+ perl_uuid_t *u1;
+ perl_uuid_t *u2;
PREINIT:
int i;
CODE:
@@ -380,7 +380,7 @@
void
to_string(self,uuid)
uuid_context_t *self;
- uuid_t *uuid;
+ perl_uuid_t *uuid;
ALIAS:
Data::UUID::to_hexstring = F_HEX
Data::UUID::to_b64string = F_B64
@@ -396,7 +396,7 @@
Data::UUID::from_hexstring = F_HEX
Data::UUID::from_b64string = F_B64
PREINIT:
- uuid_t uuid;
+ perl_uuid_t uuid;
char *from, *to;
int i, c;
unsigned char buf[4];
@@ -406,10 +406,10 @@
case F_STR:
case F_HEX:
from = str;
- memset(&uuid, 0x00, sizeof(uuid_t));
+ memset(&uuid, 0x00, sizeof(perl_uuid_t));
if ( from[0] == '0' && from[1] == 'x' )
from += 2;
- for (i = 0; i < sizeof(uuid_t); i++) {
+ for (i = 0; i < sizeof(perl_uuid_t); i++) {
if (*from == '-')
from++;
if (sscanf(from, "%2x", &c) != 1)
diff -u Data-UUID-0.11/typemap Data-UUID-0.11-new/typemap
--- Data-UUID-0.11/typemap 2003-08-27 15:38:35.000000000 -0400
+++ Data-UUID-0.11-new/typemap 2005-05-14 23:29:18.000000000 -0400
@@ -1,4 +1,4 @@
-uuid_t* T_PV
+perl_uuid_t* T_PV
uuid_context_t* T_PTRUUID
INPUT