summaryrefslogtreecommitdiff
path: root/config_h.SH
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2021-06-20 19:35:13 +0000
committerTony Cook <tony@develop-help.com>2021-09-07 15:46:16 +1000
commit65f7068160bfc9a3f4b195a579c881188cc4fff3 (patch)
tree2d628c83f8daab915975f364a33e81e6b00eafad /config_h.SH
parent756f0910f92bc6bc2d2c7eb17f26efccdf977cdc (diff)
downloadperl-65f7068160bfc9a3f4b195a579c881188cc4fff3.tar.gz
A Configure test for C11 thread local storage specificer, _Thread_local
We also provbe for gcc's earlier syntax, __thread.
Diffstat (limited to 'config_h.SH')
-rwxr-xr-xconfig_h.SH12
1 files changed, 12 insertions, 0 deletions
diff --git a/config_h.SH b/config_h.SH
index 82677a4a1c..9652cad49d 100755
--- a/config_h.SH
+++ b/config_h.SH
@@ -1073,6 +1073,18 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
#$d_static_inline HAS_STATIC_INLINE /**/
#define PERL_STATIC_INLINE $perl_static_inline /**/
+/* PERL_THREAD_LOCAL:
+ * This symbol, if defined, gives a linkage specification for thread-local
+ * storage. For example, for a C11 compiler this will be _Thread_local.
+ * Beware, some compilers are sensitive to the C language standard they are
+ * told to parse. For example, suncc defaults to C11, so our probe will
+ * report that _Thread_local can be used. However, if the -std=c99 is later
+ * added to the compiler flags, then _Thread_local will become a syntax
+ * error. Hence it is important for these flags to be consistent between
+ * probing and use.
+ */
+#$d_thread_local PERL_THREAD_LOCAL $perl_thread_local /**/
+
/* USE_STDIO_PTR:
* This symbol is defined if the _ptr and _cnt fields (or similar)
* of the stdio FILE structure can be used to access the stdio buffer