summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/iconv/config.m42
-rw-r--r--ext/iconv/config.w322
-rw-r--r--ext/iconv/iconv.c6
-rw-r--r--ext/iconv/php_iconv.h5
-rw-r--r--ext/json/config.m42
-rw-r--r--ext/json/config.w322
-rw-r--r--ext/json/json.c6
-rw-r--r--ext/json/php_json.h5
-rw-r--r--ext/session/config.m42
-rw-r--r--ext/session/config.w322
-rw-r--r--ext/session/php_session.h5
-rw-r--r--ext/session/session.c7
12 files changed, 37 insertions, 9 deletions
diff --git a/ext/iconv/config.m4 b/ext/iconv/config.m4
index 10d21ccc6d..88e5abf97e 100644
--- a/ext/iconv/config.m4
+++ b/ext/iconv/config.m4
@@ -171,7 +171,7 @@ int main() {
AC_MSG_RESULT([no])
])
- PHP_NEW_EXTENSION(iconv, iconv.c, $ext_shared,, [-I\"$PHP_ICONV_PREFIX/include\"])
+ PHP_NEW_EXTENSION(iconv, iconv.c, $ext_shared,, [-I\"$PHP_ICONV_PREFIX/include\" -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
PHP_SUBST(ICONV_SHARED_LIBADD)
PHP_INSTALL_HEADERS([ext/iconv/])
else
diff --git a/ext/iconv/config.w32 b/ext/iconv/config.w32
index 00ab272423..989a477fa5 100644
--- a/ext/iconv/config.w32
+++ b/ext/iconv/config.w32
@@ -8,7 +8,7 @@ if (PHP_ICONV != "no") {
CHECK_LIB("iconv_a.lib", "iconv", PHP_ICONV) || CHECK_LIB("iconv.lib", "iconv", PHP_ICONV)) &&
CHECK_HEADER_ADD_INCLUDE("iconv.h", "CFLAGS_ICONV", PHP_ICONV)) {
- EXTENSION("iconv", "iconv.c");
+ EXTENSION("iconv", "iconv.c", null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE("HAVE_ICONV", 1, "Define if iconv extension is enabled");
AC_DEFINE("HAVE_LIBICONV", 1, "Define if libiconv is available");
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index d425f6cf1e..4fb6df123e 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -164,12 +164,18 @@ zend_module_entry iconv_module_entry = {
/* }}} */
#ifdef COMPILE_DL_ICONV
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(iconv)
#endif
/* {{{ PHP_GINIT_FUNCTION */
static PHP_GINIT_FUNCTION(iconv)
{
+#if defined(COMPILE_DL_ICONV) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
iconv_globals->input_encoding = NULL;
iconv_globals->output_encoding = NULL;
iconv_globals->internal_encoding = NULL;
diff --git a/ext/iconv/php_iconv.h b/ext/iconv/php_iconv.h
index 1a8330ae24..b2440fc03a 100644
--- a/ext/iconv/php_iconv.h
+++ b/ext/iconv/php_iconv.h
@@ -73,7 +73,10 @@ ZEND_BEGIN_MODULE_GLOBALS(iconv)
ZEND_END_MODULE_GLOBALS(iconv)
#ifdef ZTS
-# define ICONVG(v) TSRMG(iconv_globals_id, zend_iconv_globals *, v)
+# define ICONVG(v) ZEND_TSRMG(iconv_globals_id, zend_iconv_globals *, v)
+# ifdef COMPILE_DL_ICONV
+ZEND_TSRMLS_CACHE_EXTERN;
+# endif
#else
# define ICONVG(v) (iconv_globals.v)
#endif
diff --git a/ext/json/config.m4 b/ext/json/config.m4
index 26c43a0e3f..6861a62a1f 100644
--- a/ext/json/config.m4
+++ b/ext/json/config.m4
@@ -9,7 +9,7 @@ if test "$PHP_JSON" != "no"; then
AC_DEFINE([HAVE_JSON],1 ,[whether to enable JavaScript Object Serialization support])
AC_HEADER_STDC
- PHP_NEW_EXTENSION(json, json.c utf8_decode.c JSON_parser.c, $ext_shared)
+ PHP_NEW_EXTENSION(json, json.c utf8_decode.c JSON_parser.c, $ext_shared, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_INSTALL_HEADERS([ext/json], [php_json.h])
PHP_SUBST(JSON_SHARED_LIBADD)
fi
diff --git a/ext/json/config.w32 b/ext/json/config.w32
index cedbf42829..60ccf91630 100644
--- a/ext/json/config.w32
+++ b/ext/json/config.w32
@@ -4,7 +4,7 @@
ARG_ENABLE("json", "JavaScript Object Serialization support", "yes");
if (PHP_JSON != "no") {
- EXTENSION('json', 'json.c', PHP_JSON_SHARED, "");
+ EXTENSION('json', 'json.c', PHP_JSON_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_SOURCES(configure_module_dirname, "JSON_parser.c utf8_decode.c", "json");
PHP_INSTALL_HEADERS("ext/json/", "php_json.h");
}
diff --git a/ext/json/json.c b/ext/json/json.c
index 8f4f281ef1..91bedcace9 100644
--- a/ext/json/json.c
+++ b/ext/json/json.c
@@ -125,6 +125,9 @@ static PHP_MINIT_FUNCTION(json)
*/
static PHP_GINIT_FUNCTION(json)
{
+#if defined(COMPILE_DL_JSON) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
json_globals->encoder_depth = 0;
json_globals->error_code = 0;
json_globals->encode_max_depth = 0;
@@ -153,6 +156,9 @@ zend_module_entry json_module_entry = {
/* }}} */
#ifdef COMPILE_DL_JSON
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(json)
#endif
diff --git a/ext/json/php_json.h b/ext/json/php_json.h
index 5b2dc127dd..64ad811bc7 100644
--- a/ext/json/php_json.h
+++ b/ext/json/php_json.h
@@ -44,7 +44,10 @@ ZEND_BEGIN_MODULE_GLOBALS(json)
ZEND_END_MODULE_GLOBALS(json)
#ifdef ZTS
-# define JSON_G(v) TSRMG(json_globals_id, zend_json_globals *, v)
+# define JSON_G(v) ZEND_TSRMG(json_globals_id, zend_json_globals *, v)
+# ifdef COMPILE_DL_JSON
+ZEND_TSRMLS_CACHE_EXTERN;
+# endif
#else
# define JSON_G(v) (json_globals.v)
#endif
diff --git a/ext/session/config.m4 b/ext/session/config.m4
index 1c3ba78368..f3b7340a1d 100644
--- a/ext/session/config.m4
+++ b/ext/session/config.m4
@@ -11,7 +11,7 @@ PHP_ARG_WITH(mm,for mm support,
if test "$PHP_SESSION" != "no"; then
PHP_PWRITE_TEST
PHP_PREAD_TEST
- PHP_NEW_EXTENSION(session, mod_user_class.c session.c mod_files.c mod_mm.c mod_user.c, $ext_shared)
+ PHP_NEW_EXTENSION(session, mod_user_class.c session.c mod_files.c mod_mm.c mod_user.c, $ext_shared, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_ADD_EXTENSION_DEP(session, hash, true)
PHP_ADD_EXTENSION_DEP(session, spl)
PHP_SUBST(SESSION_SHARED_LIBADD)
diff --git a/ext/session/config.w32 b/ext/session/config.w32
index c8b217aad9..942f595da1 100644
--- a/ext/session/config.w32
+++ b/ext/session/config.w32
@@ -4,7 +4,7 @@
ARG_ENABLE("session", "session support", "yes");
if (PHP_SESSION == "yes") {
- EXTENSION("session", "mod_user_class.c session.c mod_files.c mod_mm.c mod_user.c", false /* never shared */);
+ EXTENSION("session", "mod_user_class.c session.c mod_files.c mod_mm.c mod_user.c", false /* never shared */, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE("HAVE_PHP_SESSION", 1, "Session support");
PHP_INSTALL_HEADERS("ext/session/", "mod_mm.h php_session.h mod_files.h mod_user.h");
}
diff --git a/ext/session/php_session.h b/ext/session/php_session.h
index 9fb6477056..1bd6d561b7 100644
--- a/ext/session/php_session.h
+++ b/ext/session/php_session.h
@@ -189,7 +189,10 @@ extern zend_module_entry session_module_entry;
#define phpext_session_ptr &session_module_entry
#ifdef ZTS
-#define PS(v) TSRMG(ps_globals_id, php_ps_globals *, v)
+#define PS(v) ZEND_TSRMG(ps_globals_id, php_ps_globals *, v)
+#ifdef COMPILE_DL_SESSION
+ZEND_TSRMLS_CACHE_EXTERN;
+#endif
#else
#define PS(v) (ps_globals.v)
#endif
diff --git a/ext/session/session.c b/ext/session/session.c
index dae965b048..d8f92d2d57 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -2399,6 +2399,10 @@ static PHP_GINIT_FUNCTION(ps) /* {{{ */
{
int i;
+#if defined(COMPILE_DL_SESSION) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
+
ps_globals->save_path = NULL;
ps_globals->session_name = NULL;
ps_globals->id = NULL;
@@ -2825,6 +2829,9 @@ zend_module_entry session_module_entry = {
};
#ifdef COMPILE_DL_SESSION
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(session)
#endif