From: Bart Van Assche Date: Mon, 13 Oct 2008 19:22:35 +0000 (+0000) Subject: Replaced test for FILE::_lock by a more direct test. X-Git-Tag: svn/VALGRIND_3_4_0~220 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a25936ab6dd59900a23fd6af64870537fd1d027;p=thirdparty%2Fvalgrind.git Replaced test for FILE::_lock by a more direct test. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8670 --- diff --git a/configure.in b/configure.in index 7eb76ae14f..0ad582185b 100644 --- a/configure.in +++ b/configure.in @@ -708,6 +708,26 @@ AC_MSG_RESULT([no]) ]) +# Check whether FILE has a member called _lock and whether it's a pointer. + +AC_MSG_CHECKING([for FILE::_lock]) + +AC_TRY_COMPILE( +[ + #include +], [ + void *p; + p = stdout->_lock; + return 0; +], [ +AC_MSG_RESULT([yes]) +AC_DEFINE([HAVE_LIBC_FILE_LOCK], 1, + [Define to 1 if FILE has a member called _lock.]) +], [ +AC_MSG_RESULT([no]) +]) + + # Check whether pthread_mutex_t has a member called __m_kind. AC_MSG_CHECKING([for pthread_mutex_t::__m_kind]) @@ -1261,7 +1281,6 @@ AC_HEADER_STDC AC_CHECK_HEADERS([ \ endian.h \ mqueue.h \ - bits/libc-lock.h \ sys/endian.h \ sys/epoll.h \ sys/eventfd.h \ diff --git a/drd/drd_pthread_intercepts.c b/drd/drd_pthread_intercepts.c index da4e552295..e16845d106 100644 --- a/drd/drd_pthread_intercepts.c +++ b/drd/drd_pthread_intercepts.c @@ -103,7 +103,7 @@ static void init(void) /* more than one thread. Suppress data race reports on these objects. */ DRD_IGNORE_VAR(*stdout); DRD_IGNORE_VAR(*stderr); -#if defined(HAVE_BITS_LIBC_LOCK_H) +#if defined(HAVE_LIBC_FILE_LOCK) DRD_IGNORE_VAR(*(pthread_mutex_t*)(stdout->_lock)); DRD_IGNORE_VAR(*(pthread_mutex_t*)(stderr->_lock)); #endif