From ad66ea43a3ad401e1c155825da33336c8971e656 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 21 Sep 2021 15:45:00 +0300 Subject: [PATCH] Revert addition of get_generic_std_category, get_system_std_category (they need `this`); do not use std::system_category on Cygwin --- .../system/detail/error_category_impl.hpp | 30 ++++++------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/include/boost/system/detail/error_category_impl.hpp b/include/boost/system/detail/error_category_impl.hpp index 89683a6..417f7da 100644 --- a/include/boost/system/detail/error_category_impl.hpp +++ b/include/boost/system/detail/error_category_impl.hpp @@ -102,11 +102,11 @@ namespace boost { namespace system { -namespace detail -{ -inline std::error_category const & get_generic_std_category() +inline error_category::operator std::error_category const & () const { + if( id_ == detail::generic_category_id ) + { #if defined(BOOST_GCC) && BOOST_GCC < 50000 static const boost::system::detail::std_category generic_instance( this, 0x1F4D3 ); @@ -117,11 +117,13 @@ inline std::error_category const & get_generic_std_category() return std::generic_category(); #endif -} + } -inline std::error_category const & get_system_std_category() -{ -#if 0 + if( id_ == detail::system_category_id ) + { +#if defined(__CYGWIN__) + + // Under Cygwin, std::system_category() is POSIX static const boost::system::detail::std_category system_instance( this, 0x1F4D7 ); return system_instance; @@ -131,20 +133,6 @@ inline std::error_category const & get_system_std_category() return std::system_category(); #endif -} - -} // namespace detail - -inline error_category::operator std::error_category const & () const -{ - if( id_ == detail::generic_category_id ) - { - return detail::get_generic_std_category(); - } - - if( id_ == detail::system_category_id ) - { - return detail::get_system_std_category(); } detail::std_category* p = ps_.load( std::memory_order_acquire );