From 9dc13fd82a8d4e488355d550e551d21f1d560c09 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 14 Jun 2021 02:09:31 +0300 Subject: [PATCH] Change value() when holding std::error_code --- include/boost/system/detail/error_code.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/system/detail/error_code.hpp b/include/boost/system/detail/error_code.hpp index 8d3df1b..66849b4 100644 --- a/include/boost/system/detail/error_code.hpp +++ b/include/boost/system/detail/error_code.hpp @@ -139,7 +139,7 @@ public: #if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR) std::error_code const& ec = *reinterpret_cast( d2_ ); - return ec.value() + static_cast( reinterpret_cast( &ec.category() ) % 1073741789 /* 2^30-35, prime*/ ); + return ec.value() + 1000 * static_cast( reinterpret_cast( &ec.category() ) % 2097143 ); // 2^21-9, prime #else return -1;