Use BOOST_LIBSTDCXX_VERSION instead of BOOST_GCC; update syscat condition

This commit is contained in:
Peter Dimov
2022-02-07 03:02:49 +02:00
parent a1cb578f52
commit 4b143cdacc
3 changed files with 6 additions and 4 deletions

View File

@ -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;

View File

@ -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() );

View File

@ -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() );