summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorrpluem <rpluem@13f79535-47bb-0310-9956-ffa450edef68>2022-03-09 13:05:17 +0000
committerrpluem <rpluem@13f79535-47bb-0310-9956-ffa450edef68>2022-03-09 13:05:17 +0000
commit3c38284092c98c1c1fc856d1c6371c1eb4d3aec0 (patch)
tree813d90ec3c4d762eea668a387f4715bd1b4a69a9 /include
parented60afc9eb92cb231ab2abcf92de910155118a44 (diff)
downloadlibapr-3c38284092c98c1c1fc856d1c6371c1eb4d3aec0.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
Diffstat (limited to 'include')
-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