diff --git a/include/asio/error.hpp b/include/asio/error.hpp index 596c9b9860..23e50bb812 100644 --- a/include/asio/error.hpp +++ b/include/asio/error.hpp @@ -357,9 +357,10 @@ inline asio::error_code make_error_code(misc_errors e) // boostify: non-boost code starts here namespace detail { - +#if !defined(ASIO_ERROR_NUMBER_TO_CONDITION_DECLARED) +#define ASIO_ERROR_NUMBER_TO_CONDITION_DECLARED ASIO_DECL std::error_condition error_number_to_condition(int ev); - +#endif } // namespace detail // boostify: non-boost code ends here } // namespace error diff --git a/include/asio/impl/error_code.ipp b/include/asio/impl/error_code.ipp index 69ec24ea17..cfb84dc9f5 100644 --- a/include/asio/impl/error_code.ipp +++ b/include/asio/impl/error_code.ipp @@ -35,7 +35,11 @@ namespace asio { namespace error { namespace detail { + // Forward declaration required when error.hpp has not been included. +#if !defined(ASIO_ERROR_NUMBER_TO_CONDITION_DECLARED) +#define ASIO_ERROR_NUMBER_TO_CONDITION_DECLARED ASIO_DECL std::error_condition error_number_to_condition(int ev); +#endif } // namespace detail } // namespace error