mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 02:02:38 +01:00
ircd: Add suite for equating std::system_category() with boost::system.
This commit is contained in:
parent
cfcbbad0c0
commit
4c85f11a02
2 changed files with 32 additions and 0 deletions
|
@ -15,6 +15,7 @@
|
|||
namespace boost::system
|
||||
{
|
||||
struct error_code;
|
||||
struct error_category;
|
||||
struct system_error;
|
||||
namespace errc {}
|
||||
}
|
||||
|
@ -39,6 +40,11 @@ namespace ircd
|
|||
template<class... args> std::exception_ptr make_system_eptr(args&&...);
|
||||
template<class... args> [[noreturn]] void throw_system_error(args&&...);
|
||||
|
||||
bool system_category(const std::error_category &);
|
||||
bool system_category(const std::error_code &);
|
||||
bool system_category(const boost::system::error_category &);
|
||||
bool system_category(const boost::system::error_code &);
|
||||
|
||||
string_view string(const mutable_buffer &, const std::error_code &);
|
||||
string_view string(const mutable_buffer &, const std::system_error &);
|
||||
string_view string(const mutable_buffer &, const boost::system::error_code &);
|
||||
|
|
|
@ -87,6 +87,32 @@ ircd::string(const mutable_buffer &buf,
|
|||
};
|
||||
}
|
||||
|
||||
bool
|
||||
ircd::system_category(const boost::system::error_code &ec)
|
||||
{
|
||||
return system_category(ec.category());
|
||||
}
|
||||
|
||||
bool
|
||||
ircd::system_category(const boost::system::error_category &ec)
|
||||
{
|
||||
return ec == boost::system::system_category();
|
||||
}
|
||||
|
||||
bool
|
||||
ircd::system_category(const std::error_code &ec)
|
||||
{
|
||||
return system_category(ec.category());
|
||||
}
|
||||
|
||||
bool
|
||||
ircd::system_category(const std::error_category &ec)
|
||||
{
|
||||
return ec == std::system_category() ||
|
||||
ec == std::generic_category() ||
|
||||
ec == boost::system::system_category();
|
||||
}
|
||||
|
||||
std::system_error
|
||||
ircd::make_system_error(const boost::system::system_error &e)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue