diff --git a/src/windows/ipc_sync_wrappers.cpp b/src/windows/ipc_sync_wrappers.cpp index bd8975c..0822079 100644 --- a/src/windows/ipc_sync_wrappers.cpp +++ b/src/windows/ipc_sync_wrappers.cpp @@ -266,11 +266,13 @@ bool interprocess_semaphore::is_semaphore_zero_count_emulated(boost::detail::win return false; } +#if !defined(BOOST_MSVC) || _MSC_VER >= 1800 BOOST_CONSTEXPR_OR_CONST uint32_t interprocess_mutex::lock_flag_bit; BOOST_CONSTEXPR_OR_CONST uint32_t interprocess_mutex::event_set_flag_bit; BOOST_CONSTEXPR_OR_CONST uint32_t interprocess_mutex::lock_flag_value; BOOST_CONSTEXPR_OR_CONST uint32_t interprocess_mutex::event_set_flag_value; BOOST_CONSTEXPR_OR_CONST uint32_t interprocess_mutex::waiter_count_mask; +#endif void interprocess_mutex::lock_slow() { diff --git a/src/windows/ipc_sync_wrappers.hpp b/src/windows/ipc_sync_wrappers.hpp index 3768dd0..537e763 100644 --- a/src/windows/ipc_sync_wrappers.hpp +++ b/src/windows/ipc_sync_wrappers.hpp @@ -404,11 +404,23 @@ private: interprocess_event m_event; shared_state* m_shared_state; +#if !defined(BOOST_MSVC) || _MSC_VER >= 1800 static BOOST_CONSTEXPR_OR_CONST uint32_t lock_flag_bit = 31u; static BOOST_CONSTEXPR_OR_CONST uint32_t event_set_flag_bit = 30u; static BOOST_CONSTEXPR_OR_CONST uint32_t lock_flag_value = 1u << lock_flag_bit; static BOOST_CONSTEXPR_OR_CONST uint32_t event_set_flag_value = 1u << event_set_flag_bit; static BOOST_CONSTEXPR_OR_CONST uint32_t waiter_count_mask = event_set_flag_value - 1u; +#else + // MSVC 8-11, inclusively, fail to link if these constants are declared as static constants instead of an enum + enum + { + lock_flag_bit = 31u, + event_set_flag_bit = 30u, + lock_flag_value = 1u << lock_flag_bit, + event_set_flag_value = 1u << event_set_flag_bit, + waiter_count_mask = event_set_flag_value - 1u + }; +#endif public: interprocess_mutex() BOOST_NOEXCEPT : m_shared_state(NULL) diff --git a/src/windows/mapped_shared_memory.cpp b/src/windows/mapped_shared_memory.cpp index 7a79cc7..24011e8 100644 --- a/src/windows/mapped_shared_memory.cpp +++ b/src/windows/mapped_shared_memory.cpp @@ -41,8 +41,10 @@ namespace ipc { namespace aux { +//! A special permission that is required to be able to read the shared memory segment size +BOOST_CONSTEXPR_OR_CONST boost::detail::winapi::DWORD_ SECTION_QUERY_ = 0x00000001; + boost::atomic< mapped_shared_memory::nt_query_section_t > mapped_shared_memory::nt_query_section(static_cast< mapped_shared_memory::nt_query_section_t >(NULL)); -const boost::detail::winapi::DWORD_ mapped_shared_memory::SECTION_QUERY_; mapped_shared_memory::~mapped_shared_memory() { diff --git a/src/windows/mapped_shared_memory.hpp b/src/windows/mapped_shared_memory.hpp index ab3b235..8caf29f 100644 --- a/src/windows/mapped_shared_memory.hpp +++ b/src/windows/mapped_shared_memory.hpp @@ -54,8 +54,6 @@ private: void* m_mapped_address; std::size_t m_size; static boost::atomic< nt_query_section_t > nt_query_section; - //! A special permission that is required to be able to read the shared memory segment size - static const boost::detail::winapi::DWORD_ SECTION_QUERY_ = 0x00000001; public: BOOST_CONSTEXPR mapped_shared_memory() BOOST_NOEXCEPT :