diff --git a/include/boost/system/detail/error_category_impl.hpp b/include/boost/system/detail/error_category_impl.hpp index af93c1a..07101c1 100644 --- a/include/boost/system/detail/error_category_impl.hpp +++ b/include/boost/system/detail/error_category_impl.hpp @@ -108,7 +108,7 @@ inline error_category::operator std::error_category const & () const if( id_ == detail::generic_category_id ) { // This condition must be the same as the one in error_condition.hpp -#if defined(BOOST_GCC) && BOOST_GCC < 50000 +#if defined(BOOST_LIBSTDCXX_VERSION) && BOOST_LIBSTDCXX_VERSION < 50000 static const boost::system::detail::std_category generic_instance( this, 0x1F4D3 ); return generic_instance; @@ -123,10 +123,12 @@ inline error_category::operator std::error_category const & () const if( id_ == detail::system_category_id ) { // This condition must be the same as the one in error_code.hpp -#if defined(__CYGWIN__) || defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER == 1800) || (defined(BOOST_GCC) && BOOST_GCC < 50000) +#if defined(__CYGWIN__) || defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER == 1800) || (defined(BOOST_LIBSTDCXX_VERSION) && BOOST_LIBSTDCXX_VERSION < 90000) // Under Cygwin (and MinGW!), std::system_category() is POSIX // Under VS2013, std::system_category() isn't quite right + // Under libstdc++ before 7.4, before 8.3, before 9.1, default_error_condition + // for the system category returns a condition from the system category static const boost::system::detail::std_category system_instance( this, 0x1F4D7 ); return system_instance; diff --git a/include/boost/system/detail/error_code.hpp b/include/boost/system/detail/error_code.hpp index 1cd01e6..f7d9d30 100644 --- a/include/boost/system/detail/error_code.hpp +++ b/include/boost/system/detail/error_code.hpp @@ -575,7 +575,7 @@ public: else if( lc_flags_ == 0 ) { // This condition must be the same as the one in error_category_impl.hpp -#if defined(__CYGWIN__) || defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER == 1800) || (defined(BOOST_GCC) && BOOST_GCC < 50000) +#if defined(__CYGWIN__) || defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER == 1800) || (defined(BOOST_LIBSTDCXX_VERSION) && BOOST_LIBSTDCXX_VERSION < 90000) return std::error_code( 0, boost::system::system_category() ); diff --git a/include/boost/system/detail/error_condition.hpp b/include/boost/system/detail/error_condition.hpp index 255b282..b54498b 100644 --- a/include/boost/system/detail/error_condition.hpp +++ b/include/boost/system/detail/error_condition.hpp @@ -223,7 +223,7 @@ public: operator std::error_condition () const { // This condition must be the same as the one in error_category_impl.hpp -#if defined(BOOST_GCC) && BOOST_GCC < 50000 +#if defined(BOOST_LIBSTDCXX_VERSION) && BOOST_LIBSTDCXX_VERSION < 50000 return std::error_condition( value(), category() );