LRN: fix RAND_MAX on W32:
authorChristian Grothoff <christian@grothoff.org>
Sun, 10 Jun 2012 22:42:23 +0000 (22:42 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sun, 10 Jun 2012 22:42:23 +0000 (22:42 +0000)
MinGW stdlib.h defines it to 0x7FFF, but our implementation is better.

src/util/crypto_random.c

index 35d3c41e9e167bb679d29c59d62e4854e376677e..e8522d5e768942428c83e1f29ecfc804a59bfcc4 100644 (file)
 #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