summaryrefslogtreecommitdiff
path: root/ext/intl
diff options
context:
space:
mode:
Diffstat (limited to 'ext/intl')
-rw-r--r--ext/intl/config.m42
-rw-r--r--ext/intl/config.w322
-rw-r--r--ext/intl/converter/converter.c12
-rw-r--r--ext/intl/php_intl.c6
-rw-r--r--ext/intl/php_intl.h5
5 files changed, 12 insertions, 15 deletions
diff --git a/ext/intl/config.m4 b/ext/intl/config.m4
index 5afee4809e..0fbbd0f786 100644
--- a/ext/intl/config.m4
+++ b/ext/intl/config.m4
@@ -85,7 +85,7 @@ if test "$PHP_INTL" != "no"; then
breakiterator/codepointiterator_internal.cpp \
breakiterator/codepointiterator_methods.cpp \
idn/idn.c \
- $icu_spoof_src, $ext_shared,,$ICU_INCS -Wno-write-strings -D__STDC_LIMIT_MACROS)
+ $icu_spoof_src, $ext_shared,,$ICU_INCS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_ADD_BUILD_DIR($ext_builddir/collator)
PHP_ADD_BUILD_DIR($ext_builddir/converter)
PHP_ADD_BUILD_DIR($ext_builddir/common)
diff --git a/ext/intl/config.w32 b/ext/intl/config.w32
index 22cde6bd6d..4628e434f7 100644
--- a/ext/intl/config.w32
+++ b/ext/intl/config.w32
@@ -8,7 +8,7 @@ if (PHP_INTL != "no") {
CHECK_HEADER_ADD_INCLUDE("unicode/utf.h", "CFLAGS_INTL")) {
// always build as shared - zend_strtod.c/ICU type conflict
EXTENSION("intl", "php_intl.c intl_convert.c intl_convertcpp.cpp intl_error.c ", true,
- "/I \"" + configure_module_dirname + "\"");
+ "/I \"" + configure_module_dirname + "\" /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_SOURCES(configure_module_dirname + "/collator", "\
collator.c \
collator_attr.c \
diff --git a/ext/intl/converter/converter.c b/ext/intl/converter/converter.c
index b27652aa9a..eb37ce00f1 100644
--- a/ext/intl/converter/converter.c
+++ b/ext/intl/converter/converter.c
@@ -24,9 +24,6 @@
#include "../intl_error.h"
typedef struct _php_converter_object {
-#ifdef ZTS
- void ***tsrm_ls;
-#endif
UConverter *src, *dest;
zend_fcall_info to_cb, from_cb;
zend_fcall_info_cache to_cache, from_cache;
@@ -229,9 +226,6 @@ static void php_converter_to_u_callback(const void *context,
php_converter_object *objval = (php_converter_object*)context;
zval retval;
zval zargs[4];
-#ifdef ZTS
- TSRMLS_D = objval->tsrm_ls;
-#endif
ZVAL_LONG(&zargs[0], reason);
ZVAL_STRINGL(&zargs[1], args->source, args->sourceLimit - args->source);
@@ -308,9 +302,6 @@ static void php_converter_from_u_callback(const void *context,
zval retval;
zval zargs[4];
int i;
-#ifdef ZTS
- TSRMLS_D = objval->tsrm_ls;
-#endif
ZVAL_LONG(&zargs[0], reason);
array_init(&zargs[1]);
@@ -1045,9 +1036,6 @@ static zend_object *php_converter_object_ctor(zend_class_entry *ce, php_converte
objval = ecalloc(1, sizeof(php_converter_object) + sizeof(zval) * (ce->default_properties_count - 1));
zend_object_std_init(&objval->obj, ce TSRMLS_CC );
-#ifdef ZTS
- objval->tsrm_ls = TSRMLS_C;
-#endif
intl_error_init(&(objval->error) TSRMLS_CC);
objval->obj.handlers = &php_converter_object_handlers;
diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c
index 2c5e74809d..15f058d2b4 100644
--- a/ext/intl/php_intl.c
+++ b/ext/intl/php_intl.c
@@ -893,12 +893,18 @@ zend_module_entry intl_module_entry = {
/* }}} */
#ifdef COMPILE_DL_INTL
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE( intl )
#endif
/* {{{ intl_init_globals */
static PHP_GINIT_FUNCTION(intl)
{
+#if defined(COMPILE_DL_INTL) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
memset( intl_globals, 0, sizeof(zend_intl_globals) );
}
/* }}} */
diff --git a/ext/intl/php_intl.h b/ext/intl/php_intl.h
index 3625c4fdcc..265cdb7b9e 100644
--- a/ext/intl/php_intl.h
+++ b/ext/intl/php_intl.h
@@ -56,7 +56,10 @@ ZEND_END_MODULE_GLOBALS(intl)
/* Macro to access request-wide global variables. */
#ifdef ZTS
-#define INTL_G(v) TSRMG(intl_globals_id, zend_intl_globals *, v)
+#define INTL_G(v) ZEND_TSRMG(intl_globals_id, zend_intl_globals *, v)
+#ifdef COMPILE_DL_INTL
+ZEND_TSRMLS_CACHE_EXTERN;
+#endif
#else
#define INTL_G(v) (intl_globals.v)
#endif