re PR libstdc++/64203 (shared_mutex compile errors on bare-metal targets)
authorJonathan Wakely <jwakely@redhat.com>
Tue, 9 Dec 2014 11:03:57 +0000 (11:03 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 9 Dec 2014 11:03:57 +0000 (11:03 +0000)
PR libstdc++/64203
* include/std/shared_mutex: Fix preprocessor conditions.
* testsuite/experimental/feat-cxx14.cc: Check conditions.

From-SVN: r218511

libstdc++-v3/ChangeLog
libstdc++-v3/include/std/shared_mutex
libstdc++-v3/testsuite/experimental/feat-cxx14.cc

index 29b1a7c7a7d2af561fc53b2b428f1e32d08fe8e4..79c9b4e09d386c2159da72c1c672ead60c818ac2 100644 (file)
@@ -1,3 +1,9 @@
+2014-12-09  Jonathan Wakely  <jwakely@redhat.com>
+
+       PR libstdc++/64203
+       * include/std/shared_mutex: Fix preprocessor conditions.
+       * testsuite/experimental/feat-cxx14.cc: Check conditions.
+
 2014-12-05  Jonathan Wakely  <jwakely@redhat.com>
 
        * include/bits/hashtable_policy.h (_Map_base::operator[],
index 6405f1025ecd0420d83f5dba9a1972302c70e22d..c193eb2d90e90ce96639fbc4c656df1046156dba 100644 (file)
 #else
 
 #include <bits/c++config.h>
-#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
-# include <mutex>
-# include <condition_variable>
-#endif
+#include <mutex>
+#include <condition_variable>
 #include <bits/functexcept.h>
 
 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<typename _Mutex>
@@ -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
index 1c590dd841bff42c9aa1f67fe26e68362faebb8b..2cc31ca03be030c06af9c30cb8484459706439dd 100644 (file)
 #  error "<shared_mutex>"
 #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