aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crypto/compat/posix_win.c2
-rw-r--r--include/compat/sys/time.h11
2 files changed, 6 insertions, 7 deletions
diff --git a/crypto/compat/posix_win.c b/crypto/compat/posix_win.c
index 60b2896..14b79f5 100644
--- a/crypto/compat/posix_win.c
+++ b/crypto/compat/posix_win.c
@@ -303,7 +303,7 @@ int gettimeofday(struct timeval *tp, void *tzp)
303 time = ((uint64_t)file_time.dwLowDateTime); 303 time = ((uint64_t)file_time.dwLowDateTime);
304 time += ((uint64_t)file_time.dwHighDateTime) << 32; 304 time += ((uint64_t)file_time.dwHighDateTime) << 32;
305 305
306 tp->tv_sec = (long long)((time - EPOCH) / 10000000L); 306 tp->tv_sec = (long)((time - EPOCH) / 10000000L);
307 tp->tv_usec = (long)(system_time.wMilliseconds * 1000); 307 tp->tv_usec = (long)(system_time.wMilliseconds * 1000);
308 return 0; 308 return 0;
309} 309}
diff --git a/include/compat/sys/time.h b/include/compat/sys/time.h
index 2448969..0388333 100644
--- a/include/compat/sys/time.h
+++ b/include/compat/sys/time.h
@@ -7,16 +7,15 @@
7#define LIBCRYPTOCOMPAT_SYS_TIME_H 7#define LIBCRYPTOCOMPAT_SYS_TIME_H
8 8
9#ifdef _MSC_VER 9#ifdef _MSC_VER
10/*
11 * Use the winsock struct timeval: it is what <openssl/dtls1.h> gives
12 * callers of DTLSv1_get_timeout() and the dgram BIO ctrls, so libssl
13 * must be built against the same layout.
14 */
10#include <winsock2.h> 15#include <winsock2.h>
11 16
12#define timeval libressl_timeval
13#define gettimeofday libressl_gettimeofday 17#define gettimeofday libressl_gettimeofday
14 18
15struct timeval {
16 long long tv_sec;
17 long tv_usec;
18};
19
20int gettimeofday(struct timeval *tp, void *tzp); 19int gettimeofday(struct timeval *tp, void *tzp);
21#else 20#else
22#include_next <sys/time.h> 21#include_next <sys/time.h>