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 2023/12/05 18:13:27 UTC
svn commit: r1914369 - /apr/apr/trunk/locks/unix/proc_mutex.c
Author: ylavic
Date: Tue Dec 5 18:13:27 2023
New Revision: 1914369
URL: http://svn.apache.org/viewvc?rev=1914369&view=rev
Log:
proc_mutex: Fix macro warning.
warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
Rewrite APR_USE_PROC_PTHREAD_MUTEX_COND.
Modified:
apr/apr/trunk/locks/unix/proc_mutex.c
Modified: apr/apr/trunk/locks/unix/proc_mutex.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/locks/unix/proc_mutex.c?rev=1914369&r1=1914368&r2=1914369&view=diff
==============================================================================
--- apr/apr/trunk/locks/unix/proc_mutex.c (original)
+++ apr/apr/trunk/locks/unix/proc_mutex.c Tue Dec 5 18:13:27 2023
@@ -461,9 +461,12 @@ static const apr_proc_mutex_unix_lock_me
#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