com php-src: Mersenne Twister was added in GMP 4.2: ext/gmp/gmp.c
| From: | Stanislav Malyshev | Date: | Tue, 23 Sep 2014 22:16:26 +0000 |
| Subject: | com php-src: Mersenne Twister was added in GMP 4.2: ext/gmp/gmp.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82282@lists.php.net to get a copy of this message | ||
Commit: acd7fcf55f81955e4837c750a5e45f83d3c55ba2
Author: Leigh <leight@gmail.com> Tue, 23 Sep 2014 23:16:26 +0100
Parents: 31e27fc89ac0403aeac5ad02f09a308e830f1f05
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=acd7fcf55f81955e4837c750a5e45f83d3c55ba2
Log:
Mersenne Twister was added in GMP 4.2
Changed paths:
M ext/gmp/gmp.c
Diff:
diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c
index d38311a..301729d 100644
--- a/ext/gmp/gmp.c
+++ b/ext/gmp/gmp.c
@@ -1799,8 +1799,11 @@ void gmp_init_random()
{
if (!GMPG(rand_initialized)) {
/* Initialize */
+#if GMP_42_OR_NEWER
gmp_randinit_mt(GMPG(rand_state));
-
+#else
+ gmp_randinit_lc_2exp(GMPG(rand_state), 32L);
+#endif
/* Seed */
gmp_randseed_ui(GMPG(rand_state), GENERATE_SEED());