You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by yl...@apache.org on 2022/03/23 13:04:02 UTC

svn commit: r1899151 - in /apr/apr/branches/1.8.x: ./ include/apr_thread_proc.h

Author: ylavic
Date: Wed Mar 23 13:04:02 2022
New Revision: 1899151

URL: http://svn.apache.org/viewvc?rev=1899151&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

Backports: r1898779
Submitted by: rpluem

Modified:
    apr/apr/branches/1.8.x/   (props changed)
    apr/apr/branches/1.8.x/include/apr_thread_proc.h

Propchange: apr/apr/branches/1.8.x/
------------------------------------------------------------------------------
  Merged /apr/apr/trunk:r1898779

Modified: apr/apr/branches/1.8.x/include/apr_thread_proc.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.8.x/include/apr_thread_proc.h?rev=1899151&r1=1899150&r2=1899151&view=diff
==============================================================================
--- apr/apr/branches/1.8.x/include/apr_thread_proc.h (original)
+++ apr/apr/branches/1.8.x/include/apr_thread_proc.h Wed Mar 23 13:04:02 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