From aef04b28ff2bc18c70056b386ce8aebf554737ae Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sun, 6 Nov 2016 13:54:44 +0000 Subject: [PATCH] Fix up system type detection for QRA PRNG git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7296 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- lib/qra/qracodes/normrnd.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) 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