From a57c5683243ceacc58ee5e3bdc806f189df44dac Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 4 Sep 2023 16:28:34 +0300 Subject: [PATCH] Do not use when BOOST_USE_WINAPI_VERSION is 0x5xx (Windows XP). Fixes #113. --- include/boost/system/detail/mutex.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/boost/system/detail/mutex.hpp b/include/boost/system/detail/mutex.hpp index c27e08a..8b43b9e 100644 --- a/include/boost/system/detail/mutex.hpp +++ b/include/boost/system/detail/mutex.hpp @@ -40,13 +40,20 @@ struct mutex // issues. However, shared_mutex is based on SRWLock and its // default constructor is constexpr, so we use that instead. +#include + +// SRWLOCK is not available when targeting Windows XP +#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6 + #include #if BOOST_MSSTL_VERSION >= 142 || _HAS_SHARED_MUTEX # define BOOST_SYSTEM_HAS_MSSTL_SHARED_MUTEX #endif -#endif +#endif // BOOST_MSSTL_VERSION >= 142 || _HAS_SHARED_MUTEX + +#endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6 #if defined(BOOST_SYSTEM_HAS_MSSTL_SHARED_MUTEX)