mirror of
https://github.com/libressl/portable.git
synced 2026-01-17 21:51:17 +01:00
Attempt to fix 2038 problem with MSVC
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
|
||||
#define NO_REDEF_POSIX_FUNCTIONS
|
||||
|
||||
#include <sys/time.h>
|
||||
|
||||
#include <ws2tcpip.h>
|
||||
#include <windows.h>
|
||||
|
||||
@@ -306,7 +308,7 @@ int gettimeofday(struct timeval * tp, struct timezone * tzp)
|
||||
time = ((uint64_t)file_time.dwLowDateTime);
|
||||
time += ((uint64_t)file_time.dwHighDateTime) << 32;
|
||||
|
||||
tp->tv_sec = (long)((time - EPOCH) / 10000000L);
|
||||
tp->tv_sec = (long long)((time - EPOCH) / 10000000L);
|
||||
tp->tv_usec = (long)(system_time.wMilliseconds * 1000);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,15 @@
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <winsock2.h>
|
||||
|
||||
#define timeval libressl_timeval
|
||||
#define gettimeofday libressl_gettimeofday
|
||||
|
||||
struct timeval {
|
||||
long long tv_sec;
|
||||
long tv_usec;
|
||||
};
|
||||
|
||||
int gettimeofday(struct timeval *tp, void *tzp);
|
||||
#else
|
||||
#include_next <sys/time.h>
|
||||
|
||||
Reference in New Issue
Block a user