diff --git a/consensus/cryptonight-rs/ext/oaes_lib.c b/consensus/cryptonight-rs/ext/oaes_lib.c index 4e8b4eb6df..8cf6d44561 100644 --- a/consensus/cryptonight-rs/ext/oaes_lib.c +++ b/consensus/cryptonight-rs/ext/oaes_lib.c @@ -40,9 +40,10 @@ #endif // ANDROID, FreeBSD, OpenBSD and NetBSD also don't need timeb.h +// use sys/timeb.h for glibc <= 2.31, or MSVC #if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__ANDROID__) \ && !defined(__NetBSD__) \ - && (defined(__GLIBC__) && __GLIBC__ <= 2 && __GLIBC_MINOR__ < 31) + && ((defined(__GLIBC__) && __GLIBC__ <= 2 && __GLIBC_MINOR__ < 31) || defined(_MSC_VER)) #include #else // use gettimeofday to get rid of `ftime` warning if glibc >= 2.31 @@ -509,7 +510,7 @@ static void oaes_get_seed( char buf[RANDSIZ + 1] ) static uint32_t oaes_get_seed(void) { #if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__ANDROID__) && !defined(__NetBSD__) \ - && (defined(__GLIBC__) && __GLIBC__ <= 2 && __GLIBC_MINOR__ < 31) + && ((defined(__GLIBC__) && __GLIBC__ <= 2 && __GLIBC_MINOR__ < 31) || defined(_MSC_VER)) struct timeb timer; struct tm *gmTimer; char * _test = NULL;