Fix glibc specific conditional for Mac OS/X
authorPauli <paul.dale@oracle.com>
Wed, 7 Feb 2018 01:46:15 +0000 (11:46 +1000)
committerPauli <paul.dale@oracle.com>
Wed, 7 Feb 2018 01:46:15 +0000 (11:46 +1000)
MacOS seems to define __GLIBC__ but not __GLIBC_PREREQ.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5269)

crypto/rand/rand_lib.c

index 810677b79b3ead0d870468a49aa7e79dbfdac263..69c3c79c6da29624d0c61e04fed4c05d45e149a2 100644 (file)
@@ -231,7 +231,8 @@ static uint64_t get_timer_bits(void)
 # if defined(_POSIX_C_SOURCE) \
      && defined(_POSIX_TIMERS) \
      && _POSIX_C_SOURCE >= 199309L \
-     && (!defined(__GLIBC__) || __GLIBC_PREREQ(2, 17))
+     && (!defined(__GLIBC__) \
+         || (defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 17)))
     {
         struct timespec ts;
         clockid_t cid;