aboutsummaryrefslogtreecommitdiff
path: root/src/util/crypto_random.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-06-10 22:42:23 +0000
committerChristian Grothoff <christian@grothoff.org>2012-06-10 22:42:23 +0000
commit61e4f49afdcb778fe5a46b77f90d2ab7f3cd7d4b (patch)
treedeaa3505686ab58d8d6c8e43e6eebac6fd155592 /src/util/crypto_random.c
parent49cdfa7266ee240abcd226646408822bafd21c8c (diff)
downloadgnunet-61e4f49afdcb778fe5a46b77f90d2ab7f3cd7d4b.tar.gz
gnunet-61e4f49afdcb778fe5a46b77f90d2ab7f3cd7d4b.zip
LRN: fix RAND_MAX on W32:
MinGW stdlib.h defines it to 0x7FFF, but our implementation is better.
Diffstat (limited to 'src/util/crypto_random.c')
-rw-r--r--src/util/crypto_random.c4
1 files changed, 4 insertions, 0 deletions
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 @@
45#endif 45#endif
46#define RANDOM() glibc_weak_rand32() 46#define RANDOM() glibc_weak_rand32()
47#define SRANDOM(s) glibc_weak_srand32(s) 47#define SRANDOM(s) glibc_weak_srand32(s)
48#if defined(RAND_MAX)
49#undef RAND_MAX
50#endif
51#define RAND_MAX 0x7fffffff /* Hopefully this is correct */
48static int32_t glibc_weak_rand32_state = 1; 52static int32_t glibc_weak_rand32_state = 1;
49 53
50void 54void