diff options
Diffstat (limited to 'ext/bcmath')
-rw-r--r-- | ext/bcmath/bcmath.c | 6 | ||||
-rw-r--r-- | ext/bcmath/config.m4 | 2 | ||||
-rw-r--r-- | ext/bcmath/config.w32 | 2 | ||||
-rw-r--r-- | ext/bcmath/php_bcmath.h | 5 |
4 files changed, 12 insertions, 3 deletions
diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c index 7ef30cad5e..4f8938a108 100644 --- a/ext/bcmath/bcmath.c +++ b/ext/bcmath/bcmath.c @@ -127,6 +127,9 @@ zend_module_entry bcmath_module_entry = { }; #ifdef COMPILE_DL_BCMATH +#ifdef ZTS +ZEND_TSRMLS_CACHE_DEFINE; +#endif ZEND_GET_MODULE(bcmath) #endif @@ -140,6 +143,9 @@ PHP_INI_END() */ static PHP_GINIT_FUNCTION(bcmath) { +#if defined(COMPILE_DL_BCMATH) && defined(ZTS) + ZEND_TSRMLS_CACHE_UPDATE; +#endif bcmath_globals->bc_precision = 0; bc_init_numbers(TSRMLS_C); } diff --git a/ext/bcmath/config.m4 b/ext/bcmath/config.m4 index 3a4ad8c3b3..bc126454b4 100644 --- a/ext/bcmath/config.m4 +++ b/ext/bcmath/config.m4 @@ -11,7 +11,7 @@ libbcmath/src/add.c libbcmath/src/div.c libbcmath/src/init.c libbcmath/src/neg.c libbcmath/src/compare.c libbcmath/src/divmod.c libbcmath/src/int2num.c libbcmath/src/num2long.c libbcmath/src/output.c libbcmath/src/recmul.c \ libbcmath/src/sqrt.c libbcmath/src/zero.c libbcmath/src/debug.c libbcmath/src/doaddsub.c libbcmath/src/nearzero.c libbcmath/src/num2str.c libbcmath/src/raise.c \ libbcmath/src/rmzero.c libbcmath/src/str2num.c, - $ext_shared,,-I@ext_srcdir@/libbcmath/src) + $ext_shared,,-I@ext_srcdir@/libbcmath/src -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1) PHP_ADD_BUILD_DIR($ext_builddir/libbcmath/src) AC_DEFINE(HAVE_BCMATH, 1, [Whether you have bcmath]) fi diff --git a/ext/bcmath/config.w32 b/ext/bcmath/config.w32 index 3579eadfae..3973c10cbf 100644 --- a/ext/bcmath/config.w32 +++ b/ext/bcmath/config.w32 @@ -4,7 +4,7 @@ ARG_ENABLE("bcmath", "bc style precision math functions", "yes"); if (PHP_BCMATH == "yes") { - EXTENSION("bcmath", "bcmath.c", null, "-Iext/bcmath/libbcmath/src"); + EXTENSION("bcmath", "bcmath.c", null, "-Iext/bcmath/libbcmath/src /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); ADD_SOURCES("ext/bcmath/libbcmath/src", "add.c div.c init.c neg.c \ outofmem.c raisemod.c rt.c sub.c compare.c divmod.c int2num.c \ num2long.c output.c recmul.c sqrt.c zero.c debug.c doaddsub.c \ diff --git a/ext/bcmath/php_bcmath.h b/ext/bcmath/php_bcmath.h index 12098cff89..6647894bf0 100644 --- a/ext/bcmath/php_bcmath.h +++ b/ext/bcmath/php_bcmath.h @@ -49,7 +49,10 @@ ZEND_BEGIN_MODULE_GLOBALS(bcmath) ZEND_END_MODULE_GLOBALS(bcmath) #ifdef ZTS -# define BCG(v) TSRMG(bcmath_globals_id, zend_bcmath_globals *, v) +# define BCG(v) ZEND_TSRMG(bcmath_globals_id, zend_bcmath_globals *, v) +# ifdef COMPILE_DL_BCMATH +ZEND_TSRMLS_CACHE_EXTERN; +# endif #else # define BCG(v) (bcmath_globals.v) #endif |