diff options
Diffstat (limited to 'ext/gmp/php_gmp.h')
-rw-r--r-- | ext/gmp/php_gmp.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/ext/gmp/php_gmp.h b/ext/gmp/php_gmp.h index 6e9ee20a03..bba228a838 100644 --- a/ext/gmp/php_gmp.h +++ b/ext/gmp/php_gmp.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2015 The PHP Group | +----------------------------------------------------------------------+ @@ -66,6 +66,7 @@ ZEND_FUNCTION(gmp_or); ZEND_FUNCTION(gmp_com); ZEND_FUNCTION(gmp_xor); ZEND_FUNCTION(gmp_random); +ZEND_FUNCTION(gmp_random_seed); ZEND_FUNCTION(gmp_random_bits); ZEND_FUNCTION(gmp_random_range); ZEND_FUNCTION(gmp_setbit); @@ -77,13 +78,25 @@ ZEND_FUNCTION(gmp_popcount); ZEND_FUNCTION(gmp_hamdist); ZEND_FUNCTION(gmp_nextprime); +/* GMP and MPIR use different datatypes on different platforms */ +#ifdef PHP_WIN32 +typedef zend_long gmp_long; +typedef zend_ulong gmp_ulong; +#else +typedef long gmp_long; +typedef unsigned long gmp_ulong; +#endif + ZEND_BEGIN_MODULE_GLOBALS(gmp) zend_bool rand_initialized; gmp_randstate_t rand_state; ZEND_END_MODULE_GLOBALS(gmp) #ifdef ZTS -#define GMPG(v) TSRMG(gmp_globals_id, zend_gmp_globals *, v) +#define GMPG(v) ZEND_TSRMG(gmp_globals_id, zend_gmp_globals *, v) +#ifdef COMPILE_DL_GMP +ZEND_TSRMLS_CACHE_EXTERN; +#endif #else #define GMPG(v) (gmp_globals.v) #endif |