com php-src: get rid of TSRMLS_* in the embed SAPI: sapi/embed/php_embed.c sapi/embed/php_embed.h
| From: | Anatol Belski | Date: | Wed, 17 Dec 2014 09:52:28 +0000 |
| Subject: | com php-src: get rid of TSRMLS_* in the embed SAPI: sapi/embed/php_embed.c sapi/embed/php_embed.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-83780@lists.php.net to get a copy of this message | ||
Commit: af21b3b6dcef4ce0c04f3e8126574f5660fd0a83
Author: Anatol Belski <ab@php.net> Wed, 17 Dec 2014 10:52:28 +0100
Parents: 4acc56d5b2378b2296b94690a545af67f6775e5a
Branches: native-tls
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=af21b3b6dcef4ce0c04f3e8126574f5660fd0a83
Log:
get rid of TSRMLS_* in the embed SAPI
Changed paths:
M sapi/embed/php_embed.c
M sapi/embed/php_embed..h
Diff:
diff --git a/sapi/embed/php_embed.c b/sapi/embed/php_embed.c
index d326251..f5e6129 100644
--- a/sapi/embed/php_embed.c
+++ b/sapi/embed/php_embed.c
@@ -33,6 +33,10 @@ const char HARDCODED_INI[] =
"max_execution_time=0\n"
"max_input_time=-1\n\0";
+#if defined(PHP_WIN32) && defined(ZTS)
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
+
static char* php_embed_read_cookies(void)
{
return NULL;
@@ -152,12 +156,9 @@ static const zend_function_entry additional_functions[] = {
{NULL, NULL, NULL}
};
-EMBED_SAPI_API int php_embed_init(int argc, char **argv PTSRMLS_DC)
+EMBED_SAPI_API int php_embed_init(int argc, char **argv)
{
zend_llist global_vars;
-#ifdef ZTS
- void ***tsrm_ls = NULL;
-#endif
#ifdef HAVE_SIGNAL_H
#if defined(SIGPIPE) && defined(SIG_IGN)
@@ -172,8 +173,8 @@ EMBED_SAPI_API int php_embed_init(int argc, char **argv PTSRMLS_DC)
#ifdef ZTS
tsrm_startup(1, 1, 0, NULL);
- tsrm_ls = ts_resource(0);
- *ptsrm_ls = tsrm_ls;
+ (void)ts_resource(0);
+ ZEND_TSRMLS_CACHE_UPDATE;
#endif
sapi_startup(&php_embed_module);
diff --git a/sapi/embed/php_embed.h b/sapi/embed/php_embed.h
index e29f997..82afa68 100644
--- a/sapi/embed/php_embed.h
+++ b/sapi/embed/php_embed.h
@@ -27,29 +27,10 @@
#include <main/php_ini.h>
#include <zend_ini.h>
-#ifdef ZTS
-#define PTSRMLS_D void ****ptsrm_ls
-#define PTSRMLS_DC , PTSRMLS_D
-#define PTSRMLS_C &tsrm_ls
-#define PTSRMLS_CC , PTSRMLS_C
-
-#define PHP_EMBED_START_BLOCK(x,y) { \
- void ***tsrm_ls; \
- php_embed_init(x, y PTSRMLS_CC); \
- zend_first_try {
-
-#else
-#define PTSRMLS_D
-#define PTSRMLS_DC
-#define PTSRMLS_C
-#define PTSRMLS_CC
-
#define PHP_EMBED_START_BLOCK(x,y) { \
php_embed_init(x, y); \
zend_first_try {
-#endif
-
#define PHP_EMBED_END_BLOCK() \
} zend_catch { \
/* int exit_status = EG(exit_status); */ \
@@ -63,8 +44,12 @@
#define EMBED_SAPI_API
#endif
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_EXTERN;
+#endif
+
BEGIN_EXTERN_C()
-EMBED_SAPI_API int php_embed_init(int argc, char **argv PTSRMLS_DC);
+EMBED_SAPI_API int php_embed_init(int argc, char **argv);
EMBED_SAPI_API void php_embed_shutdown(void);
extern EMBED_SAPI_API sapi_module_struct php_embed_module;
END_EXTERN_C()