diff --git a/include/boost/system/detail/system_category.hpp b/include/boost/system/detail/system_category.hpp new file mode 100644 index 0000000..d2ddf70 --- /dev/null +++ b/include/boost/system/detail/system_category.hpp @@ -0,0 +1,65 @@ +#ifndef BOOST_SYSTEM_DETAIL_SYSTEM_CATEGORY_HPP_INCLUDED +#define BOOST_SYSTEM_DETAIL_SYSTEM_CATEGORY_HPP_INCLUDED + +// Copyright Beman Dawes 2006, 2007 +// Copyright Christoper Kohlhoff 2007 +// Copyright Peter Dimov 2017, 2018 +// +// 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) +// +// See library home page at http://www.boost.org/libs/system + +#include +#include +#include +#include +#include + +namespace boost +{ + +namespace system +{ + +namespace detail +{ + +// system_error_category + +#if ( defined( BOOST_GCC ) && BOOST_GCC >= 40600 ) || defined( BOOST_CLANG ) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" +#endif + +class BOOST_SYMBOL_VISIBLE system_error_category: public error_category +{ +public: + + BOOST_SYSTEM_CONSTEXPR system_error_category() BOOST_NOEXCEPT: + error_category( ( boost::ulong_long_type( 0x8FAFD21E ) << 32 ) + 0x25C5E09B ) + { + } + + const char * name() const BOOST_NOEXCEPT BOOST_OVERRIDE + { + return "system"; + } + + error_condition default_error_condition( int ev ) const BOOST_NOEXCEPT BOOST_OVERRIDE; + + std::string message( int ev ) const BOOST_OVERRIDE; + char const * message( int ev, char * buffer, std::size_t len ) const BOOST_NOEXCEPT BOOST_OVERRIDE; +}; + +#if ( defined( BOOST_GCC ) && BOOST_GCC >= 40600 ) || defined( BOOST_CLANG ) +#pragma GCC diagnostic pop +#endif + +} // namespace detail + +} // namespace system + +} // namespace boost + +#endif // #ifndef BOOST_SYSTEM_DETAIL_SYSTEM_CATEGORY_HPP_INCLUDED diff --git a/include/boost/system/error_code.hpp b/include/boost/system/error_code.hpp index 82fbce5..1dccb4f 100644 --- a/include/boost/system/error_code.hpp +++ b/include/boost/system/error_code.hpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -42,42 +43,6 @@ class error_code; // values defined by the operating system class error_condition; // portable generic values defined below, but ultimately // based on the POSIX standard -// predefined error categories - -#if ( defined( BOOST_GCC ) && BOOST_GCC >= 40600 ) || defined( BOOST_CLANG ) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" -#endif - -namespace detail -{ - -class BOOST_SYMBOL_VISIBLE system_error_category: public error_category -{ -public: - - BOOST_SYSTEM_CONSTEXPR system_error_category() BOOST_NOEXCEPT: - error_category( ( boost::ulong_long_type( 0x8FAFD21E ) << 32 ) + 0x25C5E09B ) - { - } - - const char * name() const BOOST_NOEXCEPT BOOST_OVERRIDE - { - return "system"; - } - - error_condition default_error_condition( int ev ) const BOOST_NOEXCEPT BOOST_OVERRIDE; - - std::string message( int ev ) const BOOST_OVERRIDE; - char const * message( int ev, char * buffer, std::size_t len ) const BOOST_NOEXCEPT BOOST_OVERRIDE; -}; - -} // namespace detail - -#if ( defined( BOOST_GCC ) && BOOST_GCC >= 40600 ) || defined( BOOST_CLANG ) -#pragma GCC diagnostic pop -#endif - // generic_category(), system_category() #if defined(BOOST_SYSTEM_HAS_CONSTEXPR)