summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2022-03-23 13:04:02 +0000
committerYann Ylavic <ylavic@apache.org>2022-03-23 13:04:02 +0000
commit7032ac58eb5d84c486050cc145f1bc74d5bcf281 (patch)
tree6e2233b29467a2530f7502b9a9652d9706a96909
parent4336248d32d77777f27c6059a8909f179275d0d7 (diff)
downloadapr-7032ac58eb5d84c486050cc145f1bc74d5bcf281.tar.gz
* Improve detection of _Thread_local
GCC < 4.9 reports __STDC_VERSION__ >= 201112 but does not implement _Thread_local. Take care of this in the condition. See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203066 Backports: r1898779 Submitted by: rpluem git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.8.x@1899151 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--include/apr_thread_proc.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h
index 04759e5a5..fe5e3206e 100644
--- a/include/apr_thread_proc.h
+++ b/include/apr_thread_proc.h
@@ -216,7 +216,9 @@ typedef enum {
*/
#if defined(__cplusplus) && __cplusplus >= 201103L
#define APR_THREAD_LOCAL thread_local
-#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112
+#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112 && \
+ (!defined(__GNUC__) || \
+ __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9))
#define APR_THREAD_LOCAL _Thread_local
#elif defined(__GNUC__) /* works for clang too */
#define APR_THREAD_LOCAL __thread