From 32dbf1b99290ced5666f6b1e8390571c02c94c5e Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 30 Apr 2023 18:44:56 +0300 Subject: [PATCH] Disable use of under the XP toolsets (v140_xp and v141_xp). Fixes #110. --- include/boost/system/detail/mutex.hpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/include/boost/system/detail/mutex.hpp b/include/boost/system/detail/mutex.hpp index 4c2b0fa..c27e08a 100644 --- a/include/boost/system/detail/mutex.hpp +++ b/include/boost/system/detail/mutex.hpp @@ -31,7 +31,9 @@ struct mutex } // namespace system } // namespace boost -#elif defined(BOOST_MSSTL_VERSION) && BOOST_MSSTL_VERSION >= 140 +#else // defined(BOOST_SYSTEM_DISABLE_THREADS) + +#if defined(BOOST_MSSTL_VERSION) && BOOST_MSSTL_VERSION >= 140 // Under the MS STL, std::mutex::mutex() is not constexpr, as is // required by the standard, which leads to initialization order @@ -40,6 +42,14 @@ struct mutex #include +#if BOOST_MSSTL_VERSION >= 142 || _HAS_SHARED_MUTEX +# define BOOST_SYSTEM_HAS_MSSTL_SHARED_MUTEX +#endif + +#endif + +#if defined(BOOST_SYSTEM_HAS_MSSTL_SHARED_MUTEX) + namespace boost { namespace system @@ -53,7 +63,7 @@ typedef std::shared_mutex mutex; } // namespace system } // namespace boost -#else +#else // defined(BOOST_SYSTEM_HAS_MSSTL_SHARED_MUTEX) #include @@ -70,7 +80,8 @@ using std::mutex; } // namespace system } // namespace boost -#endif +#endif // defined(BOOST_SYSTEM_HAS_MSSTL_SHARED_MUTEX) +#endif // defined(BOOST_SYSTEM_DISABLE_THREADS) namespace boost {