libport: Avoid issues with struct timeval on Windows.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-03-14 17:48:51 +01:00
parent fb4c127705
commit d45d751d76
2 changed files with 15 additions and 4 deletions

View File

@ -65,7 +65,6 @@ mkstemps (
static const char letters[]
= "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
static unsigned __int64 value;
struct timeval tv;
char *XXXXXX;
size_t len;
int count;
@ -80,9 +79,14 @@ mkstemps (
XXXXXX = &template[len - 6 - suffix_len];
/* Get some more or less random data. */
gettimeofday (&tv, NULL);
value += ((unsigned __int64) tv.tv_usec << 16) ^ tv.tv_sec ^ getpid ();
#ifndef _WIN32
{
struct timeval tv;
gettimeofday( &tv, NULL );
value += ((unsigned __int64) tv.tv_usec << 16) ^ tv.tv_sec;
}
#endif
value += getpid();
for (count = 0; count < TMP_MAX; ++count)
{

View File

@ -35,6 +35,13 @@
#define FD_SETSIZE 64
struct __ms_timeval
{
long tv_sec;
long tv_usec;
};
#define timeval __ms_timeval
typedef struct
{
unsigned int fd_count;