]> 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 165d2282bc85e120d0022d971b0689b283ea6577..a764ffcf625f62c720aae7abc1023cc5a4e418fa 100644 (file)
@@ -1380,8 +1380,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);
 }
 /* }}} */