From d750b39e1e7c7749881359e6b8fe2f478bf28e87 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 27 Jan 2023 18:37:23 +0200 Subject: [PATCH] Fix /RTCc failure in mulx32 --- include/boost/unordered/detail/mulx.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/boost/unordered/detail/mulx.hpp b/include/boost/unordered/detail/mulx.hpp index 1cb6af02..29345511 100644 --- a/include/boost/unordered/detail/mulx.hpp +++ b/include/boost/unordered/detail/mulx.hpp @@ -81,7 +81,16 @@ inline boost::uint64_t mulx64( boost::uint64_t x, boost::uint64_t y ) inline boost::uint32_t mulx32( boost::uint32_t x, boost::uint32_t y ) { boost::uint64_t r = (boost::uint64_t)x * y; + +#if defined(__MSVC_RUNTIME_CHECKS) + + return (boost::uint32_t)(r & UINT32_MAX) ^ (boost::uint32_t)(r >> 32); + +#else + return (boost::uint32_t)r ^ (boost::uint32_t)(r >> 32); + +#endif } #if defined(SIZE_MAX)