Skip to content

Commit 03a43d5

Browse files
krakjoebwoebi
authored andcommitted
standard tsrm usage for seven
1 parent 713ad54 commit 03a43d5

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

sapi/phpdbg/config.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if test "$BUILD_PHPDBG" == "" && test "$PHP_PHPDBG" != "no"; then
2121
AC_DEFINE(PHPDBG_DEBUG, 0, [ ])
2222
fi
2323

24-
PHP_PHPDBG_CFLAGS="-D_GNU_SOURCE"
24+
PHP_PHPDBG_CFLAGS="-D_GNU_SOURCE -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
2525
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"
2626

2727
if test "$PHP_READLINE" != "no" -o "$PHP_LIBEDIT" != "no"; then

sapi/phpdbg/config.w32

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ PHPDBG_SOURCES='phpdbg.c phpdbg_prompt.c phpdbg_cmd.c phpdbg_info.c phpdbg_help.
99
'phpdbg_sigio_win32.c phpdbg_eol.c phpdbg_out.c';
1010
PHPDBG_DLL='php' + PHP_VERSION + 'phpdbg.dll';
1111
PHPDBG_EXE='phpdbg.exe';
12+
PHPDBG_CFLAGS='/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1';
1213

1314
if (PHP_PHPDBG == "yes") {
14-
SAPI('phpdbg', PHPDBG_SOURCES, PHPDBG_EXE);
15+
SAPI('phpdbg', PHPDBG_SOURCES, PHPDBG_EXE, PHPDBG_CFLAGS);
1516
ADD_FLAG("LIBS_PHPDBG", "ws2_32.lib user32.lib");
1617
ADD_FLAG("CFLAGS_PHPDBG", "/D YY_NO_UNISTD_H");
1718
ADD_FLAG("LDFLAGS_PHPDBG", "/stack:8388608");

sapi/phpdbg/phpdbg.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@
5252
# include "openssl/applink.c"
5353
#endif
5454

55+
#if defined(PHP_WIN32) && defined(ZTS)
56+
ZEND_TSRMLS_CACHE_DEFINE();
57+
#endif
58+
5559
ZEND_DECLARE_MODULE_GLOBALS(phpdbg);
5660
int phpdbg_startup_run = 0;
5761

@@ -1312,10 +1316,6 @@ int main(int argc, char **argv) /* {{{ */
13121316
zend_bool is_exit;
13131317
int exit_status;
13141318

1315-
#ifdef ZTS
1316-
void ***tsrm_ls;
1317-
#endif
1318-
13191319
#ifndef _WIN32
13201320
struct sigaction sigio_struct;
13211321
struct sigaction signal_struct;
@@ -1338,8 +1338,8 @@ int main(int argc, char **argv) /* {{{ */
13381338

13391339
#ifdef ZTS
13401340
tsrm_startup(1, 1, 0, NULL);
1341-
1342-
tsrm_ls = ts_resource(0);
1341+
(void*)ts_resource(0);
1342+
ZEND_TSRMLS_CACHE_UPDATE();
13431343
#endif
13441344

13451345
#ifdef ZEND_SIGNALS
@@ -1608,7 +1608,7 @@ int main(int argc, char **argv) /* {{{ */
16081608

16091609
if (settings > (zend_phpdbg_globals *) 0x2) {
16101610
#ifdef ZTS
1611-
*((zend_phpdbg_globals *) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(phpdbg_globals_id)]) = *settings;
1611+
*((zend_phpdbg_globals *) (*((void ***) TSRMLS_CACHE))[TSRM_UNSHUFFLE_RSRC_ID(phpdbg_globals_id)]) = *settings;
16121612
#else
16131613
phpdbg_globals = *settings;
16141614
#endif

0 commit comments

Comments
 (0)