makes the associated intercepts in Helgrind and DRD un-compilable.
Add a configure test for it, and use them to guard the aforementioned
intercepts.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11875
a5019735-40e9-0310-863c-
91ae7b9d1cf9
])
+# Check for PTHREAD_RWLOCK_T
+
+AC_MSG_CHECKING([for pthread_rwlock_t])
+
+AC_TRY_COMPILE(
+[
+#define _GNU_SOURCE
+#include <pthread.h>
+], [
+ pthread_rwlock_t rwl;
+],
+[
+AC_MSG_RESULT([yes])
+AC_DEFINE([HAVE_PTHREAD_RWLOCK_T], 1,
+ [Define to 1 if you have the `pthread_rwlock_t' type.])
+], [
+AC_MSG_RESULT([no])
+])
+
+
# Check for PTHREAD_MUTEX_ADAPTIVE_NP
AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP])
PTH_FUNCS(int, semZupost, sem_post_intercept, (sem_t *sem), (sem));
+/* Android's pthread.h doesn't say anything about rwlocks, hence these
+ functions have to be conditionally compiled. */
+#if defined(HAVE_PTHREAD_RWLOCK_T)
+
static __always_inline
int pthread_rwlock_init_intercept(pthread_rwlock_t* rwlock,
const pthread_rwlockattr_t* attr)
PTH_FUNCS(int,
pthreadZurwlockZuunlock, pthread_rwlock_unlock_intercept,
(pthread_rwlock_t* rwlock), (rwlock));
+
+#endif /* defined(HAVE_PTHREAD_RWLOCK_T) */
/*--- pthread_rwlock_t functions ---*/
/*----------------------------------------------------------------*/
+/* Android's pthread.h doesn't say anything about rwlocks, hence these
+ functions have to be conditionally compiled. */
+#if defined(HAVE_PTHREAD_RWLOCK_T)
+
/* Handled: pthread_rwlock_init pthread_rwlock_destroy
pthread_rwlock_rdlock
pthread_rwlock_wrlock
# error "Unsupported OS"
#endif
+#endif /* defined(HAVE_PTHREAD_RWLOCK_T) */
+
/*----------------------------------------------------------------*/
/*--- POSIX semaphores ---*/