gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r21865 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r21865 - gnunet/src/util
Date: Mon, 11 Jun 2012 00:42:23 +0200

Author: grothoff
Date: 2012-06-11 00:42:23 +0200 (Mon, 11 Jun 2012)
New Revision: 21865

Modified:
   gnunet/src/util/crypto_random.c
Log:
LRN: fix RAND_MAX on W32:
MinGW stdlib.h defines it to 0x7FFF, but our implementation is better.


Modified: gnunet/src/util/crypto_random.c
===================================================================
--- gnunet/src/util/crypto_random.c     2012-06-10 22:41:48 UTC (rev 21864)
+++ gnunet/src/util/crypto_random.c     2012-06-10 22:42:23 UTC (rev 21865)
@@ -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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]