summaryrefslogtreecommitdiff
path: root/lang/php5/patches/patch-af
blob: 0b0d756449ef8fa74f6af3cc5197292859606677 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$NetBSD: patch-af,v 1.1 2010/03/03 02:01:40 taca Exp $

Fix php-gmp build problem with gmp-5.0.1 and later refering
http://svn.php.net/viewvc?view=revision&revision=295402.

--- gmp.c.orig	2010-01-03 09:23:27.000000000 +0000
+++ gmp.c
@@ -1396,8 +1396,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);
 }
 /* }}} */