]> granicus.if.org Git - php/commitdiff
standard tsrm usage for seven
authorJoe Watkins <krakjoe@php.net>
Sun, 6 Dec 2015 10:04:35 +0000 (10:04 +0000)
committerBob Weinand <bobwei9@hotmail.com>
Sun, 6 Dec 2015 13:06:07 +0000 (14:06 +0100)
sapi/phpdbg/config.m4
sapi/phpdbg/config.w32
sapi/phpdbg/phpdbg.c

index b7d12446693da88e7d6f6ea3de9fc28357e4775a..aa5b0efe3aa578812ee521effcf0a047efd104de 100644 (file)
@@ -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
index 8a685d334773dc2fd4b4134294331ea19426703c..2d907ee697dfffdffd62586ab4580ce43c0a3bf5 100644 (file)
@@ -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");
index d3ed746725543c8b5c97a1a9f87b25dc0869c232..af1bfc7aba72ee80a3b1c40805b916ca6ee16a63 100644 (file)
 # 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