summaryrefslogtreecommitdiff
path: root/ext/gmp
diff options
context:
space:
mode:
authorLeigh <leight@gmail.com>2014-09-23 23:16:26 +0100
committerLeigh <leight@gmail.com>2014-09-23 23:16:26 +0100
commitacd7fcf55f81955e4837c750a5e45f83d3c55ba2 (patch)
treeecf9e32a2a3c7cad1fc3f4dabc76eaef75c5bb45 /ext/gmp
parent31e27fc89ac0403aeac5ad02f09a308e830f1f05 (diff)
downloadphp-git-acd7fcf55f81955e4837c750a5e45f83d3c55ba2.tar.gz
Mersenne Twister was added in GMP 4.2
Diffstat (limited to 'ext/gmp')
-rw-r--r--ext/gmp/gmp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c
index d38311a5be..301729d563 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());