diff options
author | ylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68> | 2022-03-23 13:04:02 +0000 |
---|---|---|
committer | ylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68> | 2022-03-23 13:04:02 +0000 |
commit | 58c8b66246b37a68f01118843a9304dfdc50147f (patch) | |
tree | 6e2233b29467a2530f7502b9a9652d9706a96909 | |
parent | 1908dc8db091fc568985432c3d500febd8ae3df0 (diff) | |
download | libapr-58c8b66246b37a68f01118843a9304dfdc50147f.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.h | 4 |
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 |