forked from boostorg/system
Rename system_category_posix.hpp to is_generic_value.hpp
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
// POSIX-specific implementation details of system_error_category
|
||||
//
|
||||
#ifndef BOOST_SYSTEM_DETAIL_IS_GENERIC_VALUE_HPP_INCLUDED
|
||||
#define BOOST_SYSTEM_DETAIL_IS_GENERIC_VALUE_HPP_INCLUDED
|
||||
|
||||
// Copyright 2018 Peter Dimov
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
@ -7,6 +8,8 @@
|
||||
//
|
||||
// See library home page at http://www.boost.org/libs/system
|
||||
|
||||
#include <boost/system/detail/errc.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
@ -113,20 +116,10 @@ inline bool is_generic_value( int ev ) BOOST_NOEXCEPT
|
||||
return false;
|
||||
}
|
||||
|
||||
inline error_condition system_category_default_error_condition_posix( int ev ) BOOST_NOEXCEPT
|
||||
{
|
||||
if( is_generic_value( ev ) )
|
||||
{
|
||||
return error_condition( ev, generic_category() );
|
||||
}
|
||||
else
|
||||
{
|
||||
return error_condition( ev, system_category() );
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
} // namespace system
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_SYSTEM_DETAIL_IS_GENERIC_VALUE_HPP_INCLUDED
|
@ -3,7 +3,7 @@
|
||||
|
||||
// Copyright Beman Dawes 2006, 2007
|
||||
// Copyright Christoper Kohlhoff 2007
|
||||
// Copyright Peter Dimov 2017, 2018
|
||||
// Copyright Peter Dimov 2017, 2018, 2020
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -12,6 +12,7 @@
|
||||
|
||||
#include <boost/system/detail/system_category.hpp>
|
||||
#include <boost/system/detail/error_condition.hpp>
|
||||
#include <boost/system/detail/generic_category.hpp>
|
||||
#include <boost/system/api_config.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
@ -25,7 +26,6 @@
|
||||
|
||||
#include <boost/system/detail/system_category_message_win32.hpp>
|
||||
#include <boost/system/detail/system_category_condition_win32.hpp>
|
||||
#include <boost/system/detail/generic_category.hpp>
|
||||
|
||||
inline boost::system::error_condition boost::system::detail::system_error_category::default_error_condition( int ev ) const BOOST_NOEXCEPT
|
||||
{
|
||||
@ -54,11 +54,18 @@ inline char const * boost::system::detail::system_error_category::message( int e
|
||||
#else // #if defined(BOOST_WINDOWS_API)
|
||||
|
||||
#include <boost/system/detail/generic_category_message.hpp>
|
||||
#include <boost/system/detail/system_category_posix.hpp>
|
||||
#include <boost/system/detail/is_generic_value.hpp>
|
||||
|
||||
inline boost::system::error_condition boost::system::detail::system_error_category::default_error_condition( int ev ) const BOOST_NOEXCEPT
|
||||
{
|
||||
return system_category_default_error_condition_posix( ev );
|
||||
if( is_generic_value( ev ) )
|
||||
{
|
||||
return error_condition( ev, generic_category() );
|
||||
}
|
||||
else
|
||||
{
|
||||
return error_condition( ev, *this );
|
||||
}
|
||||
}
|
||||
|
||||
inline std::string boost::system::detail::system_error_category::message( int ev ) const
|
||||
|
Reference in New Issue
Block a user