Skip to content

Commit

Permalink
proc_mutex: Fix macro warning.
Browse files Browse the repository at this point in the history
warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]

Rewrite APR_USE_PROC_PTHREAD_MUTEX_COND.



git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1914369 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
ylavic committed Dec 5, 2023
1 parent bd6e072 commit eebff82
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions locks/unix/proc_mutex.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,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
Expand Down

0 comments on commit eebff82

Please sign in to comment.