diff options
Diffstat (limited to 'ext/mbstring')
| -rw-r--r-- | ext/mbstring/config.m4 | 2 | ||||
| -rw-r--r-- | ext/mbstring/config.w32 | 2 | ||||
| -rw-r--r-- | ext/mbstring/mbstring.c | 7 | ||||
| -rw-r--r-- | ext/mbstring/mbstring.h | 3 |
4 files changed, 11 insertions, 3 deletions
diff --git a/ext/mbstring/config.m4 b/ext/mbstring/config.m4 index 25bf238761..bd88ee4b63 100644 --- a/ext/mbstring/config.m4 +++ b/ext/mbstring/config.m4 @@ -31,7 +31,7 @@ AC_DEFUN([PHP_MBSTRING_ADD_INSTALL_HEADERS], [ ]) AC_DEFUN([PHP_MBSTRING_EXTENSION], [ - PHP_NEW_EXTENSION(mbstring, $PHP_MBSTRING_SOURCES, $ext_shared,, $PHP_MBSTRING_CFLAGS) + PHP_NEW_EXTENSION(mbstring, $PHP_MBSTRING_SOURCES, $ext_shared,, $PHP_MBSTRING_CFLAGS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1) PHP_SUBST(MBSTRING_SHARED_LIBADD) for dir in $PHP_MBSTRING_EXTRA_BUILD_DIRS; do diff --git a/ext/mbstring/config.w32 b/ext/mbstring/config.w32 index 6b7e05a329..27a8143686 100644 --- a/ext/mbstring/config.w32 +++ b/ext/mbstring/config.w32 @@ -16,7 +16,7 @@ if (PHP_MBSTRING != "no") { "-Iext/mbstring/libmbfl -Iext/mbstring/libmbfl/mbfl \ -Iext/mbstring/oniguruma /D NOT_RUBY=1 /D LIBMBFL_EXPORTS=1 \ /D HAVE_STDARG_PROTOTYPES=1 /D HAVE_CONFIG_H /D HAVE_STDLIB_H \ - /D HAVE_STRICMP /D MBFL_DLL_EXPORT=1 /D EXPORT"); + /D HAVE_STRICMP /D MBFL_DLL_EXPORT=1 /D EXPORT /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); ADD_SOURCES("ext/mbstring/libmbfl/filters", "html_entities.c \ mbfilter_7bit.c mbfilter_ascii.c mbfilter_base64.c mbfilter_big5.c \ diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 691391ab92..4cc73423d8 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -597,6 +597,9 @@ static sapi_post_entry php_post_entries[] = { /* }}} */ #ifdef COMPILE_DL_MBSTRING +#ifdef ZTS +ZEND_TSRMLS_CACHE_DEFINE; +#endif ZEND_GET_MODULE(mbstring) #endif @@ -1491,6 +1494,10 @@ PHP_INI_END() /* {{{ module global initialize handler */ static PHP_GINIT_FUNCTION(mbstring) { +#if defined(COMPILE_DL_MBSTRING) && defined(ZTS) +ZEND_TSRMLS_CACHE_UPDATE; +#endif + mbstring_globals->language = mbfl_no_language_uni; mbstring_globals->internal_encoding = NULL; mbstring_globals->current_internal_encoding = mbstring_globals->internal_encoding; diff --git a/ext/mbstring/mbstring.h b/ext/mbstring/mbstring.h index 0136f8ef7d..bc6434f81f 100644 --- a/ext/mbstring/mbstring.h +++ b/ext/mbstring/mbstring.h @@ -200,7 +200,8 @@ struct mb_overload_def { }; #ifdef ZTS -#define MBSTRG(v) TSRMG(mbstring_globals_id, zend_mbstring_globals *, v) +#define MBSTRG(v) ZEND_TSRMG(mbstring_globals_id, zend_mbstring_globals *, v) +ZEND_TSRMLS_CACHE_EXTERN; #else #define MBSTRG(v) (mbstring_globals.v) #endif |
