Re: cvs: php-src /ext/gmp config.m4 gmp.c php_gmp.h
| From: | Joe Orton | Date: | Mon, 24 Nov 2003 15:39:32 +0000 |
| Subject: | Re: cvs: php-src /ext/gmp config.m4 gmp.c php_gmp.h | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-5690@lists.php.net to get a copy of this message | ||
On Wed, Nov 19, 2003 at 04:44:07AM -0000, Jani Taskinen wrote:
...
...
> +
> + GMPG(rand_initialized) = 1;
> + }
> + mpz_urandomb(*gmpnum_result, GMPG(rand_state), GMP_ABS (limiter) * BITS_PER_MP_LIMB);
>
Do you have a release of gmp older than 4.1.2 maybe? There is only
__GMP_BITS_PER_MP_LIMB in the 4.1.2 I have here, so this broke the
build--here is a fix:
Index: ext/gmp/gmp.c
===================================================================
RCS file: /repository/php-src/ext/gmp/gmp.c,v
retrieving revision 1.29.4.5
diff -u -r1.29.4.5 gmp.c
--- ext/gmp/gmp.c 19 Nov 2003 04:44:24 -0000 1.29.4.5
+++ ext/gmp/gmp.c 24 Nov 2003 15:37:47 -0000
@@ -1079,7 +1079,10 @@
GMPG(rand_initialized) = 1;
}
- mpz_urandomb(*gmpnum_result, GMPG(rand_state), GMP_ABS (limiter) * BITS_PER_MP_LIMB);
+#ifndef __GMP_BITS_PER_MP_LIMB
+#define __GMP_BITS_PER_MP_LIMB BITS_PER_MP_LIMB
+#endif
+ mpz_urandomb(*gmpnum_result, GMPG(rand_state), GMP_ABS (limiter) * __GMP_BITS_PER_MP_LIMB);
ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp);
}