From: Yann Collet Date: Mon, 4 Dec 2017 23:57:01 +0000 (-0800) Subject: fix #911 : changed detection macro for clock_gettime() X-Git-Tag: v1.3.3^2~19^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e46194bbf95aa11b81f3cc1be83f13d3f888421d;p=thirdparty%2Fzstd.git fix #911 : changed detection macro for clock_gettime() The new macro might be a bit too restrictive. Systems which do not support new test will simply default to 's `clock_t clock()`, suffering lesser benchmark accuracy. Should it matter, the detection macro will have to be upgraded. --- diff --git a/programs/util.h b/programs/util.h index 37098f2f7..f510bc5e0 100644 --- a/programs/util.h +++ b/programs/util.h @@ -168,7 +168,7 @@ static int g_utilDisplayLevel; } return ((clockEnd - clockStart) * (U64)rate.numer) / ((U64)rate.denom); } -#elif (PLATFORM_POSIX_VERSION >= 200112L) +#elif defined __UCLIBC__ || ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 17) || __GLIBC__ > 2) #include #define UTIL_TIME_INITIALIZER { 0, 0 } typedef struct timespec UTIL_freq_t;