Alexandre Julliard : libport: Remove checks for gettimeofday().
Alexandre Julliard
julliard at winehq.org
Tue Mar 12 16:56:15 CDT 2019
Module: wine
Branch: master
Commit: cba41d9bfd1e5efbbddcb8e4181e912c579e1d96
URL: https://source.winehq.org/git/wine.git/?a=commit;h=cba41d9bfd1e5efbbddcb8e4181e912c579e1d96
Author: Alexandre Julliard <julliard at winehq.org>
Date: Tue Mar 12 19:32:22 2019 +0100
libport: Remove checks for gettimeofday().
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
configure | 1 -
configure.ac | 1 -
include/config.h.in | 3 ---
libs/port/mkstemps.c | 26 +++-----------------------
4 files changed, 3 insertions(+), 28 deletions(-)
diff --git a/configure b/configure
index 8a07748..365df4e 100755
--- a/configure
+++ b/configure
@@ -16744,7 +16744,6 @@ for ac_func in \
getifaddrs \
getopt_long_only \
getpwuid \
- gettimeofday \
getuid \
kqueue \
lstat \
diff --git a/configure.ac b/configure.ac
index db8bb6c..5c9980b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2162,7 +2162,6 @@ AC_CHECK_FUNCS(\
getifaddrs \
getopt_long_only \
getpwuid \
- gettimeofday \
getuid \
kqueue \
lstat \
diff --git a/include/config.h.in b/include/config.h.in
index 1d69e2e..7db97d3 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -264,9 +264,6 @@
/* Define to 1 if you have the <gettext-po.h> header file. */
#undef HAVE_GETTEXT_PO_H
-/* Define to 1 if you have the `gettimeofday' function. */
-#undef HAVE_GETTIMEOFDAY
-
/* Define to 1 if you have the `getuid' function. */
#undef HAVE_GETUID
diff --git a/libs/port/mkstemps.c b/libs/port/mkstemps.c
index 3ca71e8..5c8c7a3 100644
--- a/libs/port/mkstemps.c
+++ b/libs/port/mkstemps.c
@@ -31,16 +31,6 @@
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
-#ifdef HAVE_PROCESS_H
-#include <process.h>
-#endif
-
-/* We need to provide a type for gcc_uint64_t. */
-#ifdef __GNUC__
-__extension__ typedef unsigned long long gcc_uint64_t;
-#else
-typedef unsigned long gcc_uint64_t;
-#endif
#ifndef TMP_MAX
#define TMP_MAX 16384
@@ -74,10 +64,8 @@ mkstemps (
{
static const char letters[]
= "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
- static gcc_uint64_t value;
-#ifdef HAVE_GETTIMEOFDAY
+ static unsigned __int64 value;
struct timeval tv;
-#endif
char *XXXXXX;
size_t len;
int count;
@@ -92,17 +80,13 @@ mkstemps (
XXXXXX = &template[len - 6 - suffix_len];
-#ifdef HAVE_GETTIMEOFDAY
/* Get some more or less random data. */
gettimeofday (&tv, NULL);
- value += ((gcc_uint64_t) tv.tv_usec << 16) ^ tv.tv_sec ^ getpid ();
-#else
- value += getpid ();
-#endif
+ value += ((unsigned __int64) tv.tv_usec << 16) ^ tv.tv_sec ^ getpid ();
for (count = 0; count < TMP_MAX; ++count)
{
- gcc_uint64_t v = value;
+ unsigned __int64 v = value;
int fd;
/* Fill in the random bits. */
@@ -118,11 +102,7 @@ mkstemps (
v /= 62;
XXXXXX[5] = letters[v % 62];
-#ifdef VMS
- fd = open (template, O_RDWR|O_CREAT|O_EXCL, 0600, "fop=tmd");
-#else
fd = open (template, O_RDWR|O_CREAT|O_EXCL, 0600);
-#endif
if (fd >= 0)
/* The file does not exist. */
return fd;
More information about the wine-cvs
mailing list