diff --git a/lib/qra/qracodes/normrnd.c b/lib/qra/qracodes/normrnd.c index c14e3b3c1..90abfa425 100644 --- a/lib/qra/qracodes/normrnd.c +++ b/lib/qra/qracodes/normrnd.c @@ -30,18 +30,13 @@ // Windows (x64 and x86) #include // required only for GetTickCount(...) #define K_RAND_MAX UINT_MAX -#elif __unix__ // all unices, not all compilers +#elif _SVID_SOURCE || _XOPEN_SOURCE || __unix__ || (defined (__APPLE__) && defined(__MACH__)) /* POSIX or Unix or Apple */ #include #define rand_s(x) (*x)=(unsigned int)lrand48() // returns unsigned integers in the range 0..0x7FFFFFFF - #define K_RAND_MAX 0x7FFFFFFF // that's the max number generated by lrand48 - // Unix -#elif __linux__ - #include - #define rand_s(x) (*x)=(unsigned int)lrand48() // returns unsigned integers in the range 0..0x7FFFFFFF - #define K_RAND_MAX 0x7FFFFFFF // that's the max number generated by lrand48 - // linux -#elif __APPLE__ - // Mac OS, not sure if this is covered by __posix__ and/or __unix__ though... + #define K_RAND_MAX 0x7FFFFFFF // that's the max number + // generated by lrand48 +#else + #error "No good quality PRNG found" #endif