summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2022-01-25 17:55:16 +0000
committerYann Ylavic <ylavic@apache.org>2022-01-25 17:55:16 +0000
commit15cf51108fe054a74c6b5846f81927725db16027 (patch)
treed47c5478b230552641720d6f41dccabb99963e8e
parentb59fe5df751bedb133d30a5e68ca3ea0fb152ea1 (diff)
downloadhttpd-15cf51108fe054a74c6b5846f81927725db16027.tar.gz
Follow up to r1897460: !APR_HAS_THREAD implies no ap_thread_* either.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897462 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--include/httpd.h12
-rw-r--r--server/util.c2
2 files changed, 10 insertions, 4 deletions
diff --git a/include/httpd.h b/include/httpd.h
index 60e8948b87..103e04921b 100644
--- a/include/httpd.h
+++ b/include/httpd.h
@@ -2564,6 +2564,8 @@ AP_DECLARE(void *) ap_realloc(void *ptr, size_t size)
AP_FN_ATTR_WARN_UNUSED_RESULT
AP_FN_ATTR_ALLOC_SIZE(2);
+#if APR_HAS_THREADS
+
#if APR_VERSION_AT_LEAST(1,8,0)
/**
@@ -2579,9 +2581,8 @@ AP_DECLARE(void *) ap_realloc(void *ptr, size_t size)
#define ap_thread_current apr_thread_current
#define ap_thread_current_create apr_thread_current_create
-#else /* !APR_VERSION_AT_LEAST(1,8,0) */
+#else /* !APR_VERSION_AT_LEAST(1,8,0) */
-#if APR_HAS_THREADS
/**
* AP_THREAD_LOCAL keyword mapping the compiler's.
*/
@@ -2594,7 +2595,6 @@ AP_DECLARE(void *) ap_realloc(void *ptr, size_t size)
#elif defined(WIN32) && defined(_MSC_VER)
#define AP_THREAD_LOCAL __declspec(thread)
#endif
-#endif /* APR_HAS_THREADS */
#ifndef AP_THREAD_LOCAL
#define AP_HAS_THREAD_LOCAL 0
@@ -2613,6 +2613,12 @@ AP_DECLARE(apr_thread_t *) ap_thread_current(void);
#endif /* !APR_VERSION_AT_LEAST(1,8,0) */
+#else /* !APR_HAS_THREADS */
+
+#define AP_HAS_THREAD_LOCAL 0
+
+#endif /* !APR_HAS_THREADS */
+
/**
* Get server load params
* @param ld struct to populate: -1 in fields means error
diff --git a/server/util.c b/server/util.c
index 39bde9c98e..6889ea9a3f 100644
--- a/server/util.c
+++ b/server/util.c
@@ -3261,7 +3261,7 @@ AP_DECLARE(void *) ap_realloc(void *ptr, size_t size)
return p;
}
-#if !APR_VERSION_AT_LEAST(1,8,0)
+#if APR_HAS_THREADS && !APR_VERSION_AT_LEAST(1,8,0)
#if AP_HAS_THREAD_LOCAL
struct thread_ctx {