summaryrefslogtreecommitdiff
path: root/TSRM
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2017-11-15 12:45:21 +0100
committerAnatol Belski <ab@php.net>2017-11-15 12:45:21 +0100
commitc6d0c8aa3bac0a4e66b94960863b1f6d49420d7d (patch)
treef272c9a80878f7b2f418ae5379454c2db4991972 /TSRM
parent6bcace1b729f48ad378d36c4bba9e576f5f3896e (diff)
parent0e5d4ea55554872fe72e5d984b73fc21abc561fe (diff)
downloadphp-git-c6d0c8aa3bac0a4e66b94960863b1f6d49420d7d.tar.gz
Merge branch 'PHP-7.2'
* PHP-7.2: Fix C++ compatibility for TSRM_TLS
Diffstat (limited to 'TSRM')
-rw-r--r--TSRM/TSRM.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/TSRM/TSRM.h b/TSRM/TSRM.h
index 15ebcd7949..9ba9919812 100644
--- a/TSRM/TSRM.h
+++ b/TSRM/TSRM.h
@@ -144,10 +144,14 @@ TSRM_API void tsrm_free_interpreter_context(void *context);
TSRM_API void *tsrm_get_ls_cache(void);
TSRM_API uint8_t tsrm_is_main_thread(void);
-#ifdef TSRM_WIN32
-# define TSRM_TLS __declspec(thread)
+#if defined(__cplusplus) && __cplusplus > 199711L
+# define TSRM_TLS thread_local
#else
-# define TSRM_TLS __thread
+# ifdef TSRM_WIN32
+# define TSRM_TLS __declspec(thread)
+# else
+# define TSRM_TLS __thread
+# endif
#endif
#define TSRM_SHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)+1)