summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Watkins <krakjoe@php.net>2015-12-06 10:04:35 +0000
committerBob Weinand <bobwei9@hotmail.com>2015-12-06 14:06:07 +0100
commit03a43d50e1e18cc809034ce9d5de54bfc99f76f7 (patch)
treefd90e1d1a20a44548e5d6d4ecd4f5ead7abd7514
parent713ad54fec5e54fd6295902c03497664f4aa62b1 (diff)
downloadphp-git-03a43d50e1e18cc809034ce9d5de54bfc99f76f7.tar.gz
standard tsrm usage for seven
-rw-r--r--sapi/phpdbg/config.m42
-rw-r--r--sapi/phpdbg/config.w323
-rw-r--r--sapi/phpdbg/phpdbg.c14
3 files changed, 10 insertions, 9 deletions
diff --git a/sapi/phpdbg/config.m4 b/sapi/phpdbg/config.m4
index b7d1244669..aa5b0efe3a 100644
--- a/sapi/phpdbg/config.m4
+++ b/sapi/phpdbg/config.m4
@@ -21,7 +21,7 @@ if test "$BUILD_PHPDBG" == "" && test "$PHP_PHPDBG" != "no"; then
AC_DEFINE(PHPDBG_DEBUG, 0, [ ])
fi
- PHP_PHPDBG_CFLAGS="-D_GNU_SOURCE"
+ PHP_PHPDBG_CFLAGS="-D_GNU_SOURCE -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
PHP_PHPDBG_FILES="phpdbg.c phpdbg_parser.c phpdbg_lexer.c phpdbg_prompt.c phpdbg_help.c phpdbg_break.c phpdbg_print.c phpdbg_bp.c phpdbg_opcode.c phpdbg_list.c phpdbg_utils.c phpdbg_info.c phpdbg_cmd.c phpdbg_set.c phpdbg_frame.c phpdbg_watch.c phpdbg_btree.c phpdbg_sigsafe.c phpdbg_wait.c phpdbg_io.c phpdbg_eol.c phpdbg_out.c"
if test "$PHP_READLINE" != "no" -o "$PHP_LIBEDIT" != "no"; then
diff --git a/sapi/phpdbg/config.w32 b/sapi/phpdbg/config.w32
index 8a685d3347..2d907ee697 100644
--- a/sapi/phpdbg/config.w32
+++ b/sapi/phpdbg/config.w32
@@ -9,9 +9,10 @@ PHPDBG_SOURCES='phpdbg.c phpdbg_prompt.c phpdbg_cmd.c phpdbg_info.c phpdbg_help.
'phpdbg_sigio_win32.c phpdbg_eol.c phpdbg_out.c';
PHPDBG_DLL='php' + PHP_VERSION + 'phpdbg.dll';
PHPDBG_EXE='phpdbg.exe';
+PHPDBG_CFLAGS='/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1';
if (PHP_PHPDBG == "yes") {
- SAPI('phpdbg', PHPDBG_SOURCES, PHPDBG_EXE);
+ SAPI('phpdbg', PHPDBG_SOURCES, PHPDBG_EXE, PHPDBG_CFLAGS);
ADD_FLAG("LIBS_PHPDBG", "ws2_32.lib user32.lib");
ADD_FLAG("CFLAGS_PHPDBG", "/D YY_NO_UNISTD_H");
ADD_FLAG("LDFLAGS_PHPDBG", "/stack:8388608");
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index d3ed746725..af1bfc7aba 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -52,6 +52,10 @@
# include "openssl/applink.c"
#endif
+#if defined(PHP_WIN32) && defined(ZTS)
+ZEND_TSRMLS_CACHE_DEFINE();
+#endif
+
ZEND_DECLARE_MODULE_GLOBALS(phpdbg);
int phpdbg_startup_run = 0;
@@ -1312,10 +1316,6 @@ int main(int argc, char **argv) /* {{{ */
zend_bool is_exit;
int exit_status;
-#ifdef ZTS
- void ***tsrm_ls;
-#endif
-
#ifndef _WIN32
struct sigaction sigio_struct;
struct sigaction signal_struct;
@@ -1338,8 +1338,8 @@ int main(int argc, char **argv) /* {{{ */
#ifdef ZTS
tsrm_startup(1, 1, 0, NULL);
-
- tsrm_ls = ts_resource(0);
+ (void*)ts_resource(0);
+ ZEND_TSRMLS_CACHE_UPDATE();
#endif
#ifdef ZEND_SIGNALS
@@ -1608,7 +1608,7 @@ phpdbg_main:
if (settings > (zend_phpdbg_globals *) 0x2) {
#ifdef ZTS
- *((zend_phpdbg_globals *) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(phpdbg_globals_id)]) = *settings;
+ *((zend_phpdbg_globals *) (*((void ***) TSRMLS_CACHE))[TSRM_UNSHUFFLE_RSRC_ID(phpdbg_globals_id)]) = *settings;
#else
phpdbg_globals = *settings;
#endif