From 61e4f49afdcb778fe5a46b77f90d2ab7f3cd7d4b Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 10 Jun 2012 22:42:23 +0000 Subject: [PATCH] LRN: fix RAND_MAX on W32: MinGW stdlib.h defines it to 0x7FFF, but our implementation is better. --- src/util/crypto_random.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util/crypto_random.c b/src/util/crypto_random.c index 35d3c41e9..e8522d5e7 100644 --- a/src/util/crypto_random.c +++ b/src/util/crypto_random.c @@ -45,6 +45,10 @@ #endif #define RANDOM() glibc_weak_rand32() #define SRANDOM(s) glibc_weak_srand32(s) +#if defined(RAND_MAX) +#undef RAND_MAX +#endif +#define RAND_MAX 0x7fffffff /* Hopefully this is correct */ static int32_t glibc_weak_rand32_state = 1; void -- 2.25.1