Index: ossp-pkg/uuid/uuid.ac RCS File: /v/ossp/cvs/ossp-pkg/uuid/Attic/uuid.ac,v rcsdiff -q -kk '-r1.24' '-r1.25' -u '/v/ossp/cvs/ossp-pkg/uuid/Attic/uuid.ac,v' 2>/dev/null --- uuid.ac 2008/02/21 08:58:45 1.24 +++ uuid.ac 2008/02/21 15:34:51 1.25 @@ -57,6 +57,44 @@ #endif ]]) + dnl # check for existence of particular C structures + AC_MSG_CHECKING(for struct timeval) + AC_TRY_COMPILE([ +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#include + ],[ struct timeval tv; ], + [ msg="yes" ], [ msg="no" ]) + if test ".$msg" = .yes; then + AC_DEFINE(HAVE_STRUCT_TIMEVAL, 1, [define if exists "struct timeval"]) + fi + AC_MSG_RESULT([$msg]) + AC_MSG_CHECKING(for struct timezone) + AC_TRY_COMPILE([ +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#include + ],[ struct timezone tz; ], + [ msg="yes" ], [ msg="no" ]) + if test ".$msg" = .yes; then + AC_DEFINE(HAVE_STRUCT_TIMEZONE, 1, [define if exists "struct timezone"]) + fi + AC_MSG_RESULT([$msg]) + dnl # check for functions AC_CHECK_FUNCS(getifaddrs nanosleep Sleep) Index: ossp-pkg/uuid/uuid_prng.c RCS File: /v/ossp/cvs/ossp-pkg/uuid/Attic/uuid_prng.c,v rcsdiff -q -kk '-r1.17' '-r1.18' -u '/v/ossp/cvs/ossp-pkg/uuid/Attic/uuid_prng.c,v' 2>/dev/null --- uuid_prng.c 2008/02/21 08:58:45 1.17 +++ uuid_prng.c 2008/02/21 15:34:51 1.18 @@ -39,6 +39,7 @@ #include /* own headers (part 2/2) */ +#include "uuid_time.h" #include "uuid_prng.h" #include "uuid_md5.h" @@ -86,7 +87,7 @@ (*prng)->cnt = 0; /* seed the C library PRNG once */ - (void)gettimeofday(&tv, NULL); + (void)time_gettimeofday(&tv, NULL); pid = getpid(); srand((unsigned int)( ((unsigned int)pid << 16) @@ -141,7 +142,7 @@ /* approach 2: try to gather data via weaker libc PRNG API. */ while (n > 0) { /* gather new entropy */ - (void)gettimeofday(&(entropy.tv), NULL); /* source: libc time */ + (void)time_gettimeofday(&(entropy.tv), NULL); /* source: libc time */ entropy.rnd = rand(); /* source: libc PRNG */ entropy.cnt = prng->cnt++; /* source: local counter */ Index: ossp-pkg/uuid/uuid_time.h RCS File: /v/ossp/cvs/ossp-pkg/uuid/Attic/uuid_time.h,v rcsdiff -q -kk '-r1.1' '-r1.2' -u '/v/ossp/cvs/ossp-pkg/uuid/Attic/uuid_time.h,v' 2>/dev/null --- uuid_time.h 2008/02/21 08:58:45 1.1 +++ uuid_time.h 2008/02/21 15:34:51 1.2 @@ -44,8 +44,10 @@ #include #endif -#if defined(WIN32) -struct timeval { long tv_sec; long tv_usec; }; +#ifndef HAVE_STRUCT_TIMEVAL +struct timeval { long tv_sec; long tv_usec; }; +#endif +#ifndef HAVE_STRUCT_TIMEZONE struct timezone { int tz_minuteswest; int tz_dsttime; }; #endif