Commit 7607ff49 by Jerome Lambourg Committed by Jerome Lambourg

libstdc++: Strengthen the check for availability of pthread_rwlock_t

        * acinclude.m4 (_GLIBCXX_USE_PTHREAD_RWLOCK_T): Checks that
        _PTHREADS is defined after including gthr.h.
        * configure: Regenerate.

From-SVN: r279635
parent 211c667f
2019-12-20 Jerome Lambourg <lambourg@adacore.com>
* acinclude.m4 (_GLIBCXX_USE_PTHREAD_RWLOCK_T): Checks that _PTHREADS
is defined after including gthr.h.
* configure: Regenerate.
2019-12-12 Jonathan Wakely <jwakely@redhat.com>
* libsupc++/compare (common_comparison_category): Define without using
......
......@@ -4017,12 +4017,24 @@ AC_DEFUN([GLIBCXX_CHECK_GTHREADS], [
[Define if gthreads library is available.])
# Also check for pthread_rwlock_t for std::shared_timed_mutex in C++14
# but only do so if we're using pthread in the gthread library.
# On VxWorks for example, pthread_rwlock_t is defined in sys/types.h
# but the pthread library is not there by default and the gthread library
# does not use it.
AC_TRY_COMPILE([#include "gthr.h"],
[
#if (!defined(_PTHREADS))
#error
#endif
], [ac_gthread_use_pthreads=yes], [ac_gthread_use_pthreads=no])
if test x"$ac_gthread_use_pthreads" = x"yes"; then
AC_CHECK_TYPE([pthread_rwlock_t],
[AC_DEFINE([_GLIBCXX_USE_PTHREAD_RWLOCK_T], 1,
[Define if POSIX read/write locks are available in <gthr.h>.])],
[],
[#include "gthr.h"])
fi
fi
CXXFLAGS="$ac_save_CXXFLAGS"
AC_LANG_RESTORE
......
......@@ -74654,6 +74654,32 @@ $as_echo "#define _GLIBCXX_HAS_GTHREADS 1" >>confdefs.h
# Also check for pthread_rwlock_t for std::shared_timed_mutex in C++14
# but only do so if we're using pthread in the gthread library.
# On VxWorks for example, pthread_rwlock_t is defined in sys/types.h
# but the pthread library is not there by default and the gthread library
# does not use it.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include "gthr.h"
int
main ()
{
#if (!defined(_PTHREADS))
#error
#endif
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
ac_gthread_use_pthreads=yes
else
ac_gthread_use_pthreads=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test x"$ac_gthread_use_pthreads" = x"yes"; then
ac_fn_cxx_check_type "$LINENO" "pthread_rwlock_t" "ac_cv_type_pthread_rwlock_t" "#include \"gthr.h\"
"
if test "x$ac_cv_type_pthread_rwlock_t" = xyes; then :
......@@ -74663,6 +74689,7 @@ $as_echo "#define _GLIBCXX_USE_PTHREAD_RWLOCK_T 1" >>confdefs.h
fi
fi
fi
CXXFLAGS="$ac_save_CXXFLAGS"
ac_ext=c
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment