forked from ibphoenix/tomsfastmath
allow external define of FP_GEN_RANDOM
This commit is contained in:
parent
8e034dcf6e
commit
1404af6262
@ -252,18 +252,16 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* platforms that can use a better rand function */
|
|
||||||
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
|
|
||||||
#define FP_USE_ALT_RAND 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* use arc4random on platforms that support it */
|
/* use arc4random on platforms that support it */
|
||||||
#ifdef FP_USE_ALT_RAND
|
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
|
||||||
#define FP_GEN_RANDOM() arc4random()
|
#define FP_GEN_RANDOM() arc4random()
|
||||||
#define FP_GEN_RANDOM_MAX 0xffffffff
|
#define FP_GEN_RANDOM_MAX 0xffffffff
|
||||||
#else
|
#endif
|
||||||
#define FP_GEN_RANDOM() rand()
|
|
||||||
#define FP_GEN_RANDOM_MAX RAND_MAX
|
/* use rand() as fall-back if there's no better rand function */
|
||||||
|
#ifndef FP_GEN_RANDOM
|
||||||
|
#define FP_GEN_RANDOM() rand()
|
||||||
|
#define FP_GEN_RANDOM_MAX RAND_MAX
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* some default configurations.
|
/* some default configurations.
|
||||||
|
Loading…
Reference in New Issue
Block a user