// <mutex> -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
#include <bits/gthr.h>
#include <bits/move.h> // for std::swap
-#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
+#ifdef _GLIBCXX_USE_C99_STDINT_TR1
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+#ifdef _GLIBCXX_HAS_GTHREADS
// Common base class for std::mutex and std::timed_mutex
class __mutex_base
{
// matches a recursive mutex with a member 'actual'
template<typename _Rm>
- static typename enable_if<sizeof(&_Rm::actual), void>::type
+ static typename enable_if<(bool)sizeof(&_Rm::actual), void>::type
_S_destroy(_Rm* __mx)
{ __gthread_mutex_destroy(&__mx->actual); }
// matches a gthr-win32.h recursive mutex
template<typename _Rm>
- static typename enable_if<sizeof(&_Rm::sema), void>::type
+ static typename enable_if<(bool)sizeof(&_Rm::sema), void>::type
_S_destroy(_Rm* __mx)
{
__gthread_mutex_t __tmp;
}
};
#endif
+#endif // _GLIBCXX_HAS_GTHREADS
/// Do not acquire ownership of the mutex.
struct defer_lock_t { };
}
}
+#ifdef _GLIBCXX_HAS_GTHREADS
/// once_flag
struct once_flag
{
if (__e)
__throw_system_error(__e);
}
+#endif // _GLIBCXX_HAS_GTHREADS
// @} group mutexes
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
-#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
+#endif // _GLIBCXX_USE_C99_STDINT_TR1
#endif // __GXX_EXPERIMENTAL_CXX0X__