]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* Improve detection of _Thread_local
authorRuediger Pluem <rpluem@apache.org>
Wed, 9 Mar 2022 07:35:01 +0000 (07:35 +0000)
committerRuediger Pluem <rpluem@apache.org>
Wed, 9 Mar 2022 07:35:01 +0000 (07:35 +0000)
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/httpd/httpd/trunk@1898771 13f79535-47bb-0310-9956-ffa450edef68

include/httpd.h

index dfd03040933dfc5056ada2d4a8ef8e531ea60a5b..41e570799ed4654ffb6882327163b0c7b2be6dfc 100644 (file)
@@ -2587,7 +2587,9 @@ AP_DECLARE(void *) ap_realloc(void *ptr, size_t size)
  */
 #if defined(__cplusplus) && __cplusplus >= 201103L
 #define AP_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 AP_THREAD_LOCAL _Thread_local
 #elif defined(__GNUC__) /* works for clang too */
 #define AP_THREAD_LOCAL __thread