projects
/
oweals
/
gnunet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
49cdfa7
)
LRN: fix RAND_MAX on W32:
author
Christian Grothoff
<christian@grothoff.org>
Sun, 10 Jun 2012 22:42:23 +0000
(22:42 +0000)
committer
Christian 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
patch
|
blob
|
history
diff --git
a/src/util/crypto_random.c
b/src/util/crypto_random.c
index 35d3c41e9e167bb679d29c59d62e4854e376677e..e8522d5e768942428c83e1f29ecfc804a59bfcc4 100644
(file)
--- 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