mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 10:05:29 +00:00
Fix building on macOS
Adds a feature check for clockid_t Also fix a typo in a macro affecting pthread_mutex_clocklock on Linux.
This commit is contained in:
parent
8d3c8034b8
commit
68ac5ca0ea
15
configure.ac
15
configure.ac
@ -1527,6 +1527,21 @@ AC_DEFINE([HAVE_PTHREAD_RWLOCK_T], 1,
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
|
||||
# Check for CLOCKID_T
|
||||
|
||||
AC_MSG_CHECKING([for clockid_t])
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <time.h>
|
||||
]], [[
|
||||
clockid_t c;
|
||||
]])], [
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE([HAVE_CLOCKID_T], 1,
|
||||
[Define to 1 if you have the `clockid_t' type.])
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
|
||||
# Check for PTHREAD_MUTEX_ADAPTIVE_NP
|
||||
|
||||
|
||||
@ -1016,6 +1016,7 @@ PTH_FUNCS(int,
|
||||
(mutex, timeout));
|
||||
#endif /* VGO_solaris */
|
||||
|
||||
#if defined(HAVE_CLOCKID_T)
|
||||
static __always_inline
|
||||
int pthread_mutex_clocklock_intercept(pthread_mutex_t *mutex,
|
||||
clockid_t clockid,
|
||||
@ -1035,6 +1036,7 @@ int pthread_mutex_clocklock_intercept(pthread_mutex_t *mutex,
|
||||
PTH_FUNCS(int, pthreadZumutexZuclocklock, pthread_mutex_clocklock_intercept,
|
||||
(pthread_mutex_t *mutex, clockid_t clockid, const struct timespec *abs_timeout),
|
||||
(mutex, clockid, abs_timeout));
|
||||
#endif
|
||||
|
||||
static __always_inline
|
||||
int pthread_mutex_unlock_intercept(pthread_mutex_t *mutex)
|
||||
@ -1196,6 +1198,7 @@ PTH_FUNCS(int, condZureltimedwait, pthread_cond_timedwait_intercept,
|
||||
#endif /* VGO_solaris */
|
||||
|
||||
|
||||
#if defined(HAVE_CLOCKID_T)
|
||||
static __always_inline
|
||||
int pthread_cond_clockwait_intercept(pthread_cond_t *cond,
|
||||
pthread_mutex_t *mutex,
|
||||
@ -1217,6 +1220,7 @@ PTH_FUNCS(int, pthreadZucondZuclockwait, pthread_cond_clockwait_intercept,
|
||||
(pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
clockid_t clockid, const struct timespec* abstime),
|
||||
(cond, mutex, clockid, abstime));
|
||||
#endif
|
||||
|
||||
|
||||
// NOTE: be careful to intercept only pthread_cond_signal() and not Darwin's
|
||||
@ -1814,6 +1818,8 @@ PTH_FUNCS(int, pthreadZurwlockZureltimedrdlockZunp,
|
||||
(rwlock, timeout));
|
||||
#endif /* VGO_solaris */
|
||||
|
||||
|
||||
#if defined(HAVE_CLOCKID_T)
|
||||
static __always_inline
|
||||
int pthread_rwlock_clockrdlock_intercept(pthread_rwlock_t* rwlock,
|
||||
clockid_t clockid,
|
||||
@ -1834,6 +1840,7 @@ PTH_FUNCS(int,
|
||||
pthreadZurwlockZuclockrdlock, pthread_rwlock_clockrdlock_intercept,
|
||||
(pthread_rwlock_t* rwlock, clockid_t clockid, const struct timespec *timeout),
|
||||
(rwlock, clockid, timeout));
|
||||
#endif
|
||||
|
||||
static __always_inline
|
||||
int pthread_rwlock_timedwrlock_intercept(pthread_rwlock_t* rwlock,
|
||||
@ -1861,6 +1868,8 @@ PTH_FUNCS(int, pthreadZurwlockZureltimedwrlockZunp,
|
||||
(rwlock, timeout));
|
||||
#endif /* VGO_solaris */
|
||||
|
||||
|
||||
#if defined(HAVE_CLOCKID_T)
|
||||
static __always_inline
|
||||
int pthread_rwlock_clockwrlock_intercept(pthread_rwlock_t* rwlock,
|
||||
clockid_t clockid,
|
||||
@ -1881,6 +1890,7 @@ PTH_FUNCS(int,
|
||||
pthreadZurwlockZuclockwrlock, pthread_rwlock_clockwrlock_intercept,
|
||||
(pthread_rwlock_t* rwlock, clockid_t clockid, const struct timespec *timeout),
|
||||
(rwlock, clockid, timeout));
|
||||
#endif
|
||||
|
||||
|
||||
static __always_inline
|
||||
|
||||
@ -1110,7 +1110,7 @@ PTH_FUNC(int, pthreadZumutexZureltimedlock, // pthread_mutex_reltimedlock
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(VGP_linux)
|
||||
#if defined(VGO_linux)
|
||||
//-----------------------------------------------------------
|
||||
// glibc: pthread_mutex_clocklock
|
||||
//
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user