diff options
Diffstat (limited to '3rdparty/asio/include/asio/detail/wrapped_handler.hpp')
-rw-r--r-- | 3rdparty/asio/include/asio/detail/wrapped_handler.hpp | 56 |
1 files changed, 46 insertions, 10 deletions
diff --git a/3rdparty/asio/include/asio/detail/wrapped_handler.hpp b/3rdparty/asio/include/asio/detail/wrapped_handler.hpp index aff903ed38f..18ca6d3b955 100644 --- a/3rdparty/asio/include/asio/detail/wrapped_handler.hpp +++ b/3rdparty/asio/include/asio/detail/wrapped_handler.hpp @@ -2,7 +2,7 @@ // detail/wrapped_handler.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2021 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) @@ -201,19 +201,29 @@ public: }; template <typename Dispatcher, typename Handler, typename IsContinuation> -inline void* asio_handler_allocate(std::size_t size, +inline asio_handler_allocate_is_deprecated +asio_handler_allocate(std::size_t size, wrapped_handler<Dispatcher, Handler, IsContinuation>* this_handler) { +#if defined(ASIO_NO_DEPRECATED) + asio_handler_alloc_helpers::allocate(size, this_handler->handler_); + return asio_handler_allocate_is_no_longer_used(); +#else // defined(ASIO_NO_DEPRECATED) return asio_handler_alloc_helpers::allocate( size, this_handler->handler_); +#endif // defined(ASIO_NO_DEPRECATED) } template <typename Dispatcher, typename Handler, typename IsContinuation> -inline void asio_handler_deallocate(void* pointer, std::size_t size, +inline asio_handler_deallocate_is_deprecated +asio_handler_deallocate(void* pointer, std::size_t size, wrapped_handler<Dispatcher, Handler, IsContinuation>* this_handler) { asio_handler_alloc_helpers::deallocate( pointer, size, this_handler->handler_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_deallocate_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) } template <typename Dispatcher, typename Handler, typename IsContinuation> @@ -225,38 +235,56 @@ inline bool asio_handler_is_continuation( template <typename Function, typename Dispatcher, typename Handler, typename IsContinuation> -inline void asio_handler_invoke(Function& function, +inline asio_handler_invoke_is_deprecated +asio_handler_invoke(Function& function, wrapped_handler<Dispatcher, Handler, IsContinuation>* this_handler) { this_handler->dispatcher_.dispatch( rewrapped_handler<Function, Handler>( function, this_handler->handler_)); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_invoke_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) } template <typename Function, typename Dispatcher, typename Handler, typename IsContinuation> -inline void asio_handler_invoke(const Function& function, +inline asio_handler_invoke_is_deprecated +asio_handler_invoke(const Function& function, wrapped_handler<Dispatcher, Handler, IsContinuation>* this_handler) { this_handler->dispatcher_.dispatch( rewrapped_handler<Function, Handler>( function, this_handler->handler_)); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_invoke_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) } template <typename Handler, typename Context> -inline void* asio_handler_allocate(std::size_t size, +inline asio_handler_allocate_is_deprecated +asio_handler_allocate(std::size_t size, rewrapped_handler<Handler, Context>* this_handler) { +#if defined(ASIO_NO_DEPRECATED) + asio_handler_alloc_helpers::allocate(size, this_handler->handler_); + return asio_handler_allocate_is_no_longer_used(); +#else // defined(ASIO_NO_DEPRECATED) return asio_handler_alloc_helpers::allocate( - size, this_handler->context_); + size, this_handler->handler_); +#endif // defined(ASIO_NO_DEPRECATED) } template <typename Handler, typename Context> -inline void asio_handler_deallocate(void* pointer, std::size_t size, +inline asio_handler_deallocate_is_deprecated +asio_handler_deallocate(void* pointer, std::size_t size, rewrapped_handler<Handler, Context>* this_handler) { asio_handler_alloc_helpers::deallocate( pointer, size, this_handler->context_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_deallocate_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) } template <typename Dispatcher, typename Context> @@ -268,19 +296,27 @@ inline bool asio_handler_is_continuation( } template <typename Function, typename Handler, typename Context> -inline void asio_handler_invoke(Function& function, +inline asio_handler_invoke_is_deprecated +asio_handler_invoke(Function& function, rewrapped_handler<Handler, Context>* this_handler) { asio_handler_invoke_helpers::invoke( function, this_handler->context_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_invoke_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) } template <typename Function, typename Handler, typename Context> -inline void asio_handler_invoke(const Function& function, +inline asio_handler_invoke_is_deprecated +asio_handler_invoke(const Function& function, rewrapped_handler<Handler, Context>* this_handler) { asio_handler_invoke_helpers::invoke( function, this_handler->context_); +#if defined(ASIO_NO_DEPRECATED) + return asio_handler_invoke_is_no_longer_used(); +#endif // defined(ASIO_NO_DEPRECATED) } } // namespace detail |