diff --git a/contrib/win32/win32compat/inc/sys/time.h b/contrib/win32/win32compat/inc/sys/time.h index 9d1b1ee1072..21088bceef4 100644 --- a/contrib/win32/win32compat/inc/sys/time.h +++ b/contrib/win32/win32compat/inc/sys/time.h @@ -1,8 +1,16 @@ +#pragma once #include #define utimbuf _utimbuf #define utimes w32_utimes +#define timeval w32_timeval +struct timeval +{ + long long tv_sec; + long tv_usec; +}; + int usleep(unsigned int); int gettimeofday(struct timeval *, void *); int nanosleep(const struct timespec *, struct timespec *); diff --git a/contrib/win32/win32compat/misc.c b/contrib/win32/win32compat/misc.c index fd9e29e9839..ce5c90b148f 100644 --- a/contrib/win32/win32compat/misc.c +++ b/contrib/win32/win32compat/misc.c @@ -207,7 +207,7 @@ gettimeofday(struct timeval *tv, void *tz) us = (timehelper.ns - EPOCH_DELTA) / 10; /* Stuff result into the timeval */ - tv->tv_sec = (long)(us / USEC_IN_SEC); + tv->tv_sec = (long long)(us / USEC_IN_SEC); tv->tv_usec = (long)(us % USEC_IN_SEC); return 0;