Check-in Number:
|
5989 | |
Date: |
2008-Feb-21 16:34:51 (local)
2008-Feb-21 15:34:51 (UTC) |
User: | rse |
Branch: | |
Comment: |
fix remaining Win32 issues |
Tickets: |
|
Inspections: |
|
Files: |
|
ossp-pkg/uuid/uuid.ac 1.24 -> 1.25
--- 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 <unistd.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <time.h>
+ ],[ 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 <unistd.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <time.h>
+ ],[ 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)
|
|
ossp-pkg/uuid/uuid_prng.c 1.17 -> 1.18
--- 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 <fcntl.h>
/* 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 */
|
|
ossp-pkg/uuid/uuid_time.h 1.1 -> 1.2
--- 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 <sys/types.h>
#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
|
|