diff options
Diffstat (limited to 'ext/zlib')
-rw-r--r-- | ext/zlib/config.w32 | 2 | ||||
-rw-r--r-- | ext/zlib/config0.m4 | 2 | ||||
-rw-r--r-- | ext/zlib/php_zlib.h | 2 | ||||
-rw-r--r-- | ext/zlib/zlib.c | 7 |
4 files changed, 9 insertions, 4 deletions
diff --git a/ext/zlib/config.w32 b/ext/zlib/config.w32 index 000b1ccabb..1a57aa6110 100644 --- a/ext/zlib/config.w32 +++ b/ext/zlib/config.w32 @@ -7,7 +7,7 @@ if (PHP_ZLIB == "yes") { if (CHECK_LIB("zlib_a.lib;zlib.lib", "zlib", PHP_ZLIB) && CHECK_HEADER_ADD_INCLUDE("zlib.h", "CFLAGS", "..\\zlib;" + php_usual_include_suspects)) { - EXTENSION("zlib", "zlib.c zlib_fopen_wrapper.c zlib_filter.c", null, "/D ZLIB_EXPORTS"); + EXTENSION("zlib", "zlib.c zlib_fopen_wrapper.c zlib_filter.c", null, "/D ZLIB_EXPORTS /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); AC_DEFINE("HAVE_ZLIB", 1, "ZLIB support"); if (!PHP_ZLIB_SHARED) { diff --git a/ext/zlib/config0.m4 b/ext/zlib/config0.m4 index ebf67cc001..ab94c15fe0 100644 --- a/ext/zlib/config0.m4 +++ b/ext/zlib/config0.m4 @@ -9,7 +9,7 @@ PHP_ARG_WITH(zlib-dir,if the location of ZLIB install directory is defined, [ --with-zlib-dir=<DIR> Define the location of zlib install directory], no, no) if test "$PHP_ZLIB" != "no" || test "$PHP_ZLIB_DIR" != "no"; then - PHP_NEW_EXTENSION(zlib, zlib.c zlib_fopen_wrapper.c zlib_filter.c, $ext_shared) + PHP_NEW_EXTENSION(zlib, zlib.c zlib_fopen_wrapper.c zlib_filter.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1) PHP_SUBST(ZLIB_SHARED_LIBADD) if test "$PHP_ZLIB" != "yes" -a "$PHP_ZLIB" != "no"; then diff --git a/ext/zlib/php_zlib.h b/ext/zlib/php_zlib.h index ba829b5888..e5c2f37016 100644 --- a/ext/zlib/php_zlib.h +++ b/ext/zlib/php_zlib.h @@ -68,7 +68,7 @@ extern zend_module_entry php_zlib_module_entry; #ifdef ZTS # include "TSRM.h" -# define ZLIBG(v) TSRMG(zlib_globals_id, zend_zlib_globals *, v) +# define ZLIBG(v) ZEND_TSRMG(zlib_globals_id, zend_zlib_globals *, v) #else # define ZLIBG(v) (zlib_globals.v) #endif diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index c3548eae53..ffde50ba0b 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -496,7 +496,6 @@ static PHP_FUNCTION(ob_gzhandler) ZLIBG(ob_gzhandler) = php_zlib_output_handler_context_init(TSRMLS_C); } - TSRMLS_SET_CTX(ctx.tsrm_ls); ctx.op = flags; ctx.in.data = in_str; ctx.in.used = in_len; @@ -736,6 +735,9 @@ PHP_ZLIB_DECODE_FUNC(gzuncompress, PHP_ZLIB_ENCODING_DEFLATE); /* }}} */ #ifdef COMPILE_DL_ZLIB +#ifdef ZTS +ZEND_TSRMLS_CACHE_DEFINE; +#endif ZEND_GET_MODULE(php_zlib) #endif @@ -1020,6 +1022,9 @@ static PHP_MINFO_FUNCTION(zlib) /* {{{ ZEND_MODULE_GLOBALS_CTOR */ static PHP_GINIT_FUNCTION(zlib) { +#if defined(COMPILE_DL_ZLIB) && defined(ZTS) + ZEND_TSRMLS_CACHE_UPDATE; +#endif zlib_globals->ob_gzhandler = NULL; zlib_globals->handler_registered = 0; } |