]> granicus.if.org Git - php/commitdiff
- fix build when __GMP_BITS_PER_MP_LIMB is not defined but GMP_LIMB_BITS (no trace...
authorPierre Joye <pajoye@php.net>
Tue, 23 Feb 2010 11:07:39 +0000 (11:07 +0000)
committerPierre Joye <pajoye@php.net>
Tue, 23 Feb 2010 11:07:39 +0000 (11:07 +0000)
ext/gmp/gmp.c

index a54ffe98f84a5f702c3dda1c2676ebeef76159d0..f53dcd652615fd43d1494962624eb08b735b0b42 100644 (file)
@@ -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);
 }
 /* }}} */