Fix build with GMP 5+ https://bugs.php.net/bug.php?id=50990 https://github.com/php/php-src/commit/bd0a74c419f7c81c32ced26c8cd55b9c5cadcea4 --- ext/gmp/gmp.c.orig +++ ext/gmp/gmp.c @@ -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); } /* }}} */