Ralf Corsepius wrote:
On Thu, 2005-09-08 at 10:33 +0100, Paul Howarth wrote:
Attached patch appears to be in the spirit of what the author intended,
and results in working "make test" on FC4 (i386) and RHEL3 (x86_64).
RHEL3 is the only platform I have access to an x86_64 box with.
You'd better use the POSIX types from stdint.h instead of the obsolete
BSD types from sys/types.h
Also check md5.h, it contains the same issue lurking.
Thanks; revised patch attached.
Paul.
--- Data-UUID-0.11/UUID.h 2005-09-08 10:45:57.000000000 +0100
+++ Data-UUID-0.11/UUID.h 2005-09-08 10:56:26.629888207 +0100
@@ -4,6 +4,7 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
+#include <stdint.h>
#include <unistd.h>
#include <time.h>
#include "md5.h"
@@ -59,11 +60,11 @@
#define CHECK(f1, f2) if (f1 != f2) RETVAL = f1 < f2 ? -1 : 1;
-typedef unsigned long unsigned32;
-typedef unsigned short unsigned16;
-typedef unsigned char unsigned8;
-typedef unsigned char byte;
-typedef unsigned long long unsigned64_t;
+typedef uint32_t unsigned32;
+typedef uint16_t unsigned16;
+typedef uint8_t unsigned8;
+typedef uint8_t byte;
+typedef uint64_t unsigned64_t;
typedef unsigned64_t uuid_time_t;
#if defined __solaris__ || defined __linux__
--- Data-UUID-0.11/md5.h 2005-09-08 10:49:18.000000000 +0100
+++ Data-UUID-0.11/md5.h 2005-09-08 10:51:38.000000000 +0100
@@ -26,6 +26,8 @@
#ifndef _MD5_H_
#define _MD5_H_ 1
+#include <stdint.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -49,10 +51,10 @@
typedef unsigned char *POINTER;
/* UINT2 defines a two byte word */
-typedef unsigned short int UINT2;
+typedef uint16_t UINT2;
/* UINT4 defines a four byte word */
-typedef unsigned long int UINT4;
+typedef uint32_t UINT4;
#ifndef NULL_PTR
#define NULL_PTR ((POINTER)0)