diff options
Diffstat (limited to '3rdparty/asio/include/asio/error.hpp')
-rw-r--r-- | 3rdparty/asio/include/asio/error.hpp | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/3rdparty/asio/include/asio/error.hpp b/3rdparty/asio/include/asio/error.hpp index 8b4decd52d2..d676ee8aa7d 100644 --- a/3rdparty/asio/include/asio/error.hpp +++ b/3rdparty/asio/include/asio/error.hpp @@ -2,7 +2,7 @@ // error.hpp // ~~~~~~~~~ // -// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -223,6 +223,41 @@ enum misc_errors fd_set_failure }; +// boostify: non-boost code starts here +#if !defined(ASIO_ERROR_LOCATION) +# define ASIO_ERROR_LOCATION(e) (void)0 +#endif // !defined(ASIO_ERROR_LOCATION) + +// boostify: non-boost code ends here +#if !defined(ASIO_ERROR_LOCATION) \ + && !defined(ASIO_DISABLE_ERROR_LOCATION) \ + && defined(ASIO_HAS_BOOST_CONFIG) \ + && (BOOST_VERSION >= 107900) + +# define ASIO_ERROR_LOCATION(e) \ + do { \ + BOOST_STATIC_CONSTEXPR boost::source_location loc \ + = BOOST_CURRENT_LOCATION; \ + (e).assign((e), &loc); \ + } while (false) + +#else // !defined(ASIO_ERROR_LOCATION) + // && !defined(ASIO_DISABLE_ERROR_LOCATION) + // && defined(ASIO_HAS_BOOST_CONFIG) + // && (BOOST_VERSION >= 107900) + +# define ASIO_ERROR_LOCATION(e) (void)0 + +#endif // !defined(ASIO_ERROR_LOCATION) + // && !defined(ASIO_DISABLE_ERROR_LOCATION) + // && defined(ASIO_HAS_BOOST_CONFIG) + // && (BOOST_VERSION >= 107900) + +inline void clear(asio::error_code& ec) +{ + ec.assign(0, ec.category()); +} + inline const asio::error_category& get_system_category() { return asio::system_category(); @@ -269,7 +304,6 @@ static const asio::error_category& } // namespace error } // namespace asio -#if defined(ASIO_HAS_STD_SYSTEM_ERROR) namespace std { template<> struct is_error_code_enum<asio::error::basic_errors> @@ -293,7 +327,6 @@ template<> struct is_error_code_enum<asio::error::misc_errors> }; } // namespace std -#endif // defined(ASIO_HAS_STD_SYSTEM_ERROR) namespace asio { namespace error { |