diff options
-rw-r--r-- | include/httpd.h | 12 | ||||
-rw-r--r-- | server/util.c | 2 |
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 { |