mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-03-26 14:08:40 -04:00
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
This commit is contained in:
parent
8390bcd798
commit
aef04b28ff
@ -30,18 +30,13 @@
|
|||||||
// Windows (x64 and x86)
|
// Windows (x64 and x86)
|
||||||
#include <windows.h> // required only for GetTickCount(...)
|
#include <windows.h> // required only for GetTickCount(...)
|
||||||
#define K_RAND_MAX UINT_MAX
|
#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 <stdlib.h>
|
#include <stdlib.h>
|
||||||
#define rand_s(x) (*x)=(unsigned int)lrand48() // returns unsigned integers in the range 0..0x7FFFFFFF
|
#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
|
#define K_RAND_MAX 0x7FFFFFFF // that's the max number
|
||||||
// Unix
|
// generated by lrand48
|
||||||
#elif __linux__
|
#else
|
||||||
#include <stdlib.h>
|
#error "No good quality PRNG found"
|
||||||
#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...
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user