You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by rp...@apache.org on 2022/03/09 13:05:17 UTC
svn commit: r1898779 - /apr/apr/trunk/include/apr_thread_proc.h
Author: rpluem
Date: Wed Mar 9 13:05:17 2022
New Revision: 1898779
URL: http://svn.apache.org/viewvc?rev=1898779&view=rev
Log:
* 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
Modified:
apr/apr/trunk/include/apr_thread_proc.h
Modified: apr/apr/trunk/include/apr_thread_proc.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr_thread_proc.h?rev=1898779&r1=1898778&r2=1898779&view=diff
==============================================================================
--- apr/apr/trunk/include/apr_thread_proc.h (original)
+++ apr/apr/trunk/include/apr_thread_proc.h Wed Mar 9 13:05:17 2022
@@ -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