From 918d24a16e8eda9ac2eac692704770dfed96f6ee Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sun, 1 Jun 2025 22:42:51 +0200 Subject: [PATCH] Update asio wrap to 1.34.2 This fixes a compatibility issue with newer asio versions. --- CHANGELOG.md | 2 ++ src/common/communication/common.h | 13 +++++++------ subprojects/asio.wrap | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 525adc67..84dedc44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,8 @@ Versioning](https://semver.org/spec/v2.0.0.html). ### Packaging notes +- The `asio` dependency has been updated to version 1.34.2. This fixes a + compatibility issue with newer versions of `asio`. - The `system-asio` build option has been removed since `asio` added `pkg-config` support three years ago in version 1.23. diff --git a/src/common/communication/common.h b/src/common/communication/common.h index 7fd490f4..253a1262 100644 --- a/src/common/communication/common.h +++ b/src/common/communication/common.h @@ -86,9 +86,9 @@ namespace asio { // std::size_t)`, since `llvm::SmallVector` is mostly compatible with the STL // vector. template -inline ASIO_MUTABLE_BUFFER buffer(llvm::SmallVectorImpl& data) - ASIO_NOEXCEPT { - return ASIO_MUTABLE_BUFFER( +ASIO_NODISCARD inline mutable_buffer buffer( + llvm::SmallVectorImpl& data) ASIO_NOEXCEPT { + return mutable_buffer( data.size() ? &data[0] : 0, data.size() * sizeof(PodType) #if defined(ASIO_ENABLE_BUFFER_DEBUGGING) , @@ -99,9 +99,10 @@ inline ASIO_MUTABLE_BUFFER buffer(llvm::SmallVectorImpl& data) } template -inline ASIO_MUTABLE_BUFFER buffer(llvm::SmallVectorImpl& data, - std::size_t max_size_in_bytes) ASIO_NOEXCEPT { - return ASIO_MUTABLE_BUFFER( +ASIO_NODISCARD inline mutable_buffer buffer( + llvm::SmallVectorImpl& data, + std::size_t max_size_in_bytes) ASIO_NOEXCEPT { + return mutable_buffer( data.size() ? &data[0] : 0, data.size() * sizeof(PodType) < max_size_in_bytes ? data.size() * sizeof(PodType) diff --git a/subprojects/asio.wrap b/subprojects/asio.wrap index a6a3dd77..33fc4eb9 100644 --- a/subprojects/asio.wrap +++ b/subprojects/asio.wrap @@ -1,7 +1,7 @@ [wrap-git] url = https://github.com/chriskohlhoff/asio.git -# This is tag asio-1-28-2 -revision = 7609450f71434bdc9fbd9491a9505b423c2a8496 +# This is tag asio-1-34-2 +revision = ed6aa8a13d51dfc6c00ae453fc9fb7df5d6ea963 depth = 1 patch_directory = asio