From: Jonathan Wakely Date: Tue, 9 Dec 2014 11:03:57 +0000 (+0000) Subject: re PR libstdc++/64203 (shared_mutex compile errors on bare-metal targets) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=60b6534a84cd08e403ed5d1f91def59b161e8424;p=gcc.git re PR libstdc++/64203 (shared_mutex compile errors on bare-metal targets) PR libstdc++/64203 * include/std/shared_mutex: Fix preprocessor conditions. * testsuite/experimental/feat-cxx14.cc: Check conditions. From-SVN: r218511 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 29b1a7c7a7d..79c9b4e09d3 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2014-12-09 Jonathan Wakely + + PR libstdc++/64203 + * include/std/shared_mutex: Fix preprocessor conditions. + * testsuite/experimental/feat-cxx14.cc: Check conditions. + 2014-12-05 Jonathan Wakely * include/bits/hashtable_policy.h (_Map_base::operator[], diff --git a/libstdc++-v3/include/std/shared_mutex b/libstdc++-v3/include/std/shared_mutex index 6405f1025ec..c193eb2d90e 100644 --- a/libstdc++-v3/include/std/shared_mutex +++ b/libstdc++-v3/include/std/shared_mutex @@ -36,10 +36,8 @@ #else #include -#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) -# include -# include -#endif +#include +#include #include namespace std _GLIBCXX_VISIBILITY(default) @@ -51,7 +49,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @{ */ -#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) +#ifdef _GLIBCXX_USE_C99_STDINT_TR1 +#ifdef _GLIBCXX_HAS_GTHREADS #define __cpp_lib_shared_timed_mutex 201402 @@ -254,7 +253,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } } }; -#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1 +#endif // _GLIBCXX_HAS_GTHREADS /// shared_lock template @@ -393,6 +392,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION swap(shared_lock<_Mutex>& __x, shared_lock<_Mutex>& __y) noexcept { __x.swap(__y); } +#endif // _GLIBCXX_USE_C99_STDINT_TR1 + // @} group mutexes _GLIBCXX_END_NAMESPACE_VERSION } // namespace diff --git a/libstdc++-v3/testsuite/experimental/feat-cxx14.cc b/libstdc++-v3/testsuite/experimental/feat-cxx14.cc index 1c590dd841b..2cc31ca03be 100644 --- a/libstdc++-v3/testsuite/experimental/feat-cxx14.cc +++ b/libstdc++-v3/testsuite/experimental/feat-cxx14.cc @@ -106,10 +106,12 @@ # error "" #endif -#ifndef __cpp_lib_shared_timed_mutex -# error "__cpp_lib_shared_timed_mutex" -#elif __cpp_lib_shared_timed_mutex != 201402 -# error "__cpp_lib_shared_timed_mutex != 201402" +#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) +# ifndef __cpp_lib_shared_timed_mutex +# error "__cpp_lib_shared_timed_mutex" +# elif __cpp_lib_shared_timed_mutex != 201402 +# error "__cpp_lib_shared_timed_mutex != 201402" +# endif #endif #ifndef __cpp_lib_is_final