diff --git a/lib/util_mosq.c b/lib/util_mosq.c index 8f3610a..5dbf123 100644 --- a/lib/util_mosq.c +++ b/lib/util_mosq.c @@ -29,8 +29,10 @@ Contributors: #endif #if !defined(WITH_TLS) && defined(__linux__) -# if defined(__GLIBC__) && __GLIBC_PREREQ(2, 25) -# include +# if defined(__GLIBC__) +# if __GLIBC_PREREQ(2, 25) +# include +# endif # endif #endif @@ -325,10 +327,12 @@ int util__random_bytes(void *bytes, int count) if(RAND_bytes(bytes, count) == 1){ rc = MOSQ_ERR_SUCCESS; } -#elif defined(__GLIBC__) && __GLIBC_PREREQ(2, 25) +#elif defined(__GLIBC__) +# if __GLIBC_PREREQ(2, 25) if(getrandom(bytes, count, 0) == 0){ rc = MOSQ_ERR_SUCCESS; } +# endif #elif defined(WIN32) HRYPTPROV provider;