diff --git a/include/boost/system/detail/error_code.ipp b/include/boost/system/detail/error_code.ipp index 3cbe1eb..6ed777c 100644 --- a/include/boost/system/detail/error_code.ipp +++ b/include/boost/system/detail/error_code.ipp @@ -477,24 +477,39 @@ namespace detail BOOST_SYSTEM_CONST_INIT const system_error_category system_category_const; BOOST_SYSTEM_CONST_INIT const generic_error_category generic_category_const; +BOOST_SYSTEM_DECL const error_category & system_category_ncx() BOOST_SYSTEM_NOEXCEPT +{ + return system_category_const; +} + +BOOST_SYSTEM_DECL const error_category & generic_category_ncx() BOOST_SYSTEM_NOEXCEPT +{ + return generic_category_const; +} + } // namespace detail #undef BOOST_SYSTEM_CONST_INIT #else -BOOST_SYSTEM_DECL const error_category & system_category() BOOST_SYSTEM_NOEXCEPT +namespace detail { - static const detail::system_error_category system_category_const; + +BOOST_SYSTEM_DECL const error_category & system_category_ncx() BOOST_SYSTEM_NOEXCEPT +{ + static const detail::system_error_category system_category_const; return system_category_const; } -BOOST_SYSTEM_DECL const error_category & generic_category() BOOST_SYSTEM_NOEXCEPT +BOOST_SYSTEM_DECL const error_category & generic_category_ncx() BOOST_SYSTEM_NOEXCEPT { static const detail::generic_error_category generic_category_const; return generic_category_const; } +} // namespace detail + #endif } // namespace system diff --git a/include/boost/system/error_code.hpp b/include/boost/system/error_code.hpp index abef021..bb557f3 100644 --- a/include/boost/system/error_code.hpp +++ b/include/boost/system/error_code.hpp @@ -361,7 +361,7 @@ namespace detail BOOST_SYSTEM_CONSTEXPR inline const error_category & system_category() BOOST_SYSTEM_NOEXCEPT { - static const detail::system_error_category system_category_const; + static const detail::system_error_category system_category_const; return system_category_const; } @@ -393,8 +393,23 @@ constexpr const error_category & generic_category() BOOST_SYSTEM_NOEXCEPT #else - BOOST_SYSTEM_DECL const error_category & system_category() BOOST_SYSTEM_NOEXCEPT; - BOOST_SYSTEM_DECL const error_category & generic_category() BOOST_SYSTEM_NOEXCEPT; +namespace detail +{ + +BOOST_SYSTEM_DECL const error_category & system_category_ncx() BOOST_SYSTEM_NOEXCEPT; +BOOST_SYSTEM_DECL const error_category & generic_category_ncx() BOOST_SYSTEM_NOEXCEPT; + +} // namespace detail + +inline const error_category & system_category() BOOST_SYSTEM_NOEXCEPT +{ + return detail::system_category_ncx(); +} + +inline const error_category & generic_category() BOOST_SYSTEM_NOEXCEPT +{ + return detail::generic_category_ncx(); +} #endif