diff --git a/configure.ac b/configure.ac index c546a169..f34d433c 100644 --- a/configure.ac +++ b/configure.ac @@ -153,6 +153,8 @@ AC_C_BIGENDIAN dnl Checks for functions and headers +AC_CHECK_FUNC(clock_gettime, , [AC_CHECK_LIB(rt, clock_gettime)]) + AC_CHECK_FUNCS([SecureZeroMemory]) dnl Switches. diff --git a/src/curvecp/libcurvecp/nanoseconds.c b/src/curvecp/libcurvecp/nanoseconds.c index de5309d5..65e6d9f8 100644 --- a/src/curvecp/libcurvecp/nanoseconds.c +++ b/src/curvecp/libcurvecp/nanoseconds.c @@ -7,7 +7,7 @@ long long nanoseconds(void) { -#ifdef CLOCK_REALTIME +#if defined(CLOCK_REALTIME) && defined(HAVE_CLOCK_GETTIME) struct timespec t; if (clock_gettime(CLOCK_REALTIME,&t) != 0) return -1; return t.tv_sec * 1000000000LL + t.tv_nsec;