summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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());