From: Pierre Joye Date: Tue, 23 Feb 2010 11:07:39 +0000 (+0000) Subject: - fix build when __GMP_BITS_PER_MP_LIMB is not defined but GMP_LIMB_BITS (no trace... X-Git-Tag: php-5.4.0alpha1~270 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5cbece0a8eaed4738c4be476d9ddcc6a30cb8ec0;p=php - fix build when __GMP_BITS_PER_MP_LIMB is not defined but GMP_LIMB_BITS (no trace of this change in gmp's changelog...) --- diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index a54ffe98f8..f53dcd6526 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -1374,8 +1374,11 @@ ZEND_FUNCTION(gmp_random) GMPG(rand_initialized) = 1; } +#ifdef GMP_LIMB_BITS + mpz_urandomb(*gmpnum_result, GMPG(rand_state), GMP_ABS (limiter) * GMP_LIMB_BITS); +#else mpz_urandomb(*gmpnum_result, GMPG(rand_state), GMP_ABS (limiter) * __GMP_BITS_PER_MP_LIMB); - +#endif ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); } /* }}} */