Skip to content

Commit

Permalink
fix ftime warning (#3710)
Browse files Browse the repository at this point in the history
* fix `ftime` warning

* only apply after glic glibc >= 2.31

* fix bool
  • Loading branch information
jiangying000 authored Sep 5, 2022
1 parent dc3ec32 commit b1d7e4d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions consensus/cryptonight-rs/ext/oaes_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@

// ANDROID, FreeBSD, OpenBSD and NetBSD also don't need timeb.h
#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__ANDROID__) \
&& !defined(__NetBSD__)
&& !defined(__NetBSD__) \
&& (defined(__GLIBC__) && __GLIBC__ <= 2 && __GLIBC_MINOR__ < 31)
#include <sys/timeb.h>
#else
// use gettimeofday to get rid of `ftime` warning if glibc >= 2.31
// https://sourceware.org/pipermail/libc-announce/2020/000025.html
#include <sys/time.h>
#endif

Expand Down Expand Up @@ -505,7 +508,8 @@ static void oaes_get_seed( char buf[RANDSIZ + 1] )
#else
static uint32_t oaes_get_seed(void)
{
#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__ANDROID__) && !defined(__NetBSD__)
#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__ANDROID__) && !defined(__NetBSD__) \
&& (defined(__GLIBC__) && __GLIBC__ <= 2 && __GLIBC_MINOR__ < 31)
struct timeb timer;
struct tm *gmTimer;
char * _test = NULL;
Expand Down

0 comments on commit b1d7e4d

Please sign in to comment.