mirror of
https://github.com/boostorg/system.git
synced 2025-07-30 20:47:14 +02:00
Placate g++ 6 and earlier
This commit is contained in:
@ -5,6 +5,7 @@
|
|||||||
#include <boost/system/error_code.hpp>
|
#include <boost/system/error_code.hpp>
|
||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
#include <boost/config/pragma_message.hpp>
|
#include <boost/config/pragma_message.hpp>
|
||||||
|
#include <boost/config.hpp>
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
|
|
||||||
#if !defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
#if !defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||||
@ -21,9 +22,34 @@ enum my_errc
|
|||||||
my_enoent = ENOENT
|
my_enoent = ENOENT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if defined(BOOST_GCC) && BOOST_GCC < 70000
|
||||||
|
|
||||||
|
// g++ 6 and earlier do not allow specializations outside the namespace
|
||||||
|
|
||||||
|
namespace boost
|
||||||
|
{
|
||||||
|
namespace system
|
||||||
|
{
|
||||||
|
|
||||||
|
template<> struct is_error_condition_enum<my_errc>: std::true_type {};
|
||||||
|
|
||||||
|
} // namespace system
|
||||||
|
} // namespace boost
|
||||||
|
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
|
||||||
|
template<> struct is_error_condition_enum<my_errc>: std::true_type {};
|
||||||
|
|
||||||
|
} // namespace std
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
template<> struct boost::system::is_error_condition_enum<my_errc>: std::true_type {};
|
template<> struct boost::system::is_error_condition_enum<my_errc>: std::true_type {};
|
||||||
template<> struct std::is_error_condition_enum<my_errc>: std::true_type {};
|
template<> struct std::is_error_condition_enum<my_errc>: std::true_type {};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
boost::system::error_condition make_error_condition( my_errc e )
|
boost::system::error_condition make_error_condition( my_errc e )
|
||||||
{
|
{
|
||||||
return boost::system::error_condition( e, boost::system::generic_category() );
|
return boost::system::error_condition( e, boost::system::generic_category() );
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include <boost/system/error_code.hpp>
|
#include <boost/system/error_code.hpp>
|
||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
#include <boost/config/pragma_message.hpp>
|
#include <boost/config/pragma_message.hpp>
|
||||||
|
#include <boost/config.hpp>
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
|
|
||||||
#if !defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
#if !defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||||
@ -21,9 +22,34 @@ enum my_errc
|
|||||||
my_enoent = ENOENT
|
my_enoent = ENOENT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if defined(BOOST_GCC) && BOOST_GCC < 70000
|
||||||
|
|
||||||
|
// g++ 6 and earlier do not allow specializations outside the namespace
|
||||||
|
|
||||||
|
namespace boost
|
||||||
|
{
|
||||||
|
namespace system
|
||||||
|
{
|
||||||
|
|
||||||
|
template<> struct is_error_code_enum<my_errc>: std::true_type {};
|
||||||
|
|
||||||
|
} // namespace system
|
||||||
|
} // namespace boost
|
||||||
|
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
|
||||||
|
template<> struct is_error_code_enum<my_errc>: std::true_type {};
|
||||||
|
|
||||||
|
} // namespace std
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
template<> struct boost::system::is_error_code_enum<my_errc>: std::true_type {};
|
template<> struct boost::system::is_error_code_enum<my_errc>: std::true_type {};
|
||||||
template<> struct std::is_error_code_enum<my_errc>: std::true_type {};
|
template<> struct std::is_error_code_enum<my_errc>: std::true_type {};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
boost::system::error_code make_error_code( my_errc e )
|
boost::system::error_code make_error_code( my_errc e )
|
||||||
{
|
{
|
||||||
return boost::system::error_code( e, boost::system::generic_category() );
|
return boost::system::error_code( e, boost::system::generic_category() );
|
||||||
|
Reference in New Issue
Block a user