summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuediger Pluem <rpluem@apache.org>2022-03-09 13:05:17 +0000
committerRuediger Pluem <rpluem@apache.org>2022-03-09 13:05:17 +0000
commitd5f3f3ff27ee85ffc0db9966ca9478684959c40b (patch)
tree813d90ec3c4d762eea668a387f4715bd1b4a69a9
parent7bf2b07d1170ccfe0643b49b4d115d5ca5418c17 (diff)
downloadapr-d5f3f3ff27ee85ffc0db9966ca9478684959c40b.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 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1898779 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 85f697dd2..952c76d2d 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