From 660c869eece22950a61e0e5dc1db1d89c1b1b2c7 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 14 Mar 2024 15:23:02 +0000 Subject: [PATCH] proc_mutex: Fix macro warning. warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined] Rewrite APR_USE_PROC_PTHREAD_MUTEX_COND. Merges r1916301 from ^/apr/apr/branches/1.8.x Merges r1914369 trunk git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1916302 13f79535-47bb-0310-9956-ffa450edef68 --- locks/unix/proc_mutex.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/locks/unix/proc_mutex.c b/locks/unix/proc_mutex.c index ef08f934144..64ffd8bf392 100644 --- a/locks/unix/proc_mutex.c +++ b/locks/unix/proc_mutex.c @@ -467,9 +467,12 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_sysv_methods = #if APR_HAS_PROC_PTHREAD_SERIALIZE #ifndef APR_USE_PROC_PTHREAD_MUTEX_COND -#define APR_USE_PROC_PTHREAD_MUTEX_COND \ - (defined(HAVE_PTHREAD_CONDATTR_SETPSHARED) \ - && !defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK)) +#if defined(HAVE_PTHREAD_CONDATTR_SETPSHARED) \ + && !defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK) +#define APR_USE_PROC_PTHREAD_MUTEX_COND 1 +#else +#define APR_USE_PROC_PTHREAD_MUTEX_COND 0 +#endif #endif /* The mmap()ed pthread_interproc is the native pthread_mutex_t followed