From 3fde91534fa97f5cd151a93e4488e8d53c43bdcf Mon Sep 17 00:00:00 2001 From: Tyler Rockwood Date: Tue, 18 Feb 2025 04:52:17 +0000 Subject: [PATCH 1/3] sstring: fixes for lib++ 19 std::string_view's iterator is now a wrapper type over const char* so we need to use `data` instead to access the raw pointer. --- include/seastar/core/sstring.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/seastar/core/sstring.hh b/include/seastar/core/sstring.hh index 42a09dfe6f..5cef7ba709 100644 --- a/include/seastar/core/sstring.hh +++ b/include/seastar/core/sstring.hh @@ -565,7 +565,7 @@ public: } } int compare(std::basic_string_view x) const noexcept { - auto n = traits_type::compare(begin(), x.begin(), std::min(size(), x.size())); + auto n = traits_type::compare(begin(), x.data(), std::min(size(), x.size())); if (n != 0) { return n; } @@ -584,7 +584,7 @@ public: } sz = std::min(size() - pos, sz); - auto n = traits_type::compare(begin() + pos, x.begin(), std::min(sz, x.size())); + auto n = traits_type::compare(begin() + pos, x.data(), std::min(sz, x.size())); if (n != 0) { return n; } From e6c2ca9eb3013d94c568c32e1c54f77140c3f0ab Mon Sep 17 00:00:00 2001 From: Tyler Rockwood Date: Tue, 18 Feb 2025 04:53:23 +0000 Subject: [PATCH 2/3] log: fixes for libc++ 19 `std::string_view` has wrapped iterators so now we must use `data()` to access the raw `const char*` --- src/util/log.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/log.cc b/src/util/log.cc index 896eb48b0c..d60f1a84b2 100644 --- a/src/util/log.cc +++ b/src/util/log.cc @@ -157,7 +157,7 @@ void log_buf::realloc_buffer_and_append(char c) noexcept { _alloc_failure = true; std::string_view msg = "(log buffer allocation failure)"; auto can_copy = std::min(msg.size(), size_t(_current - _begin)); - std::memcpy(_current - can_copy, msg.begin(), can_copy); + std::memcpy(_current - can_copy, msg.data(), can_copy); } } From b0972f3ff6bdeca7fab53ca86b3f642da7a4366c Mon Sep 17 00:00:00 2001 From: Tyler Rockwood Date: Tue, 18 Feb 2025 04:55:04 +0000 Subject: [PATCH 3/3] net: switch rss_key_type to std::span instead of std::string_view In libc++ 19 string_view no longer supports unsigned types, so switch to std::span as the container. --- include/seastar/net/toeplitz.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/seastar/net/toeplitz.hh b/include/seastar/net/toeplitz.hh index 93fdfca4d3..b34d423ff8 100644 --- a/include/seastar/net/toeplitz.hh +++ b/include/seastar/net/toeplitz.hh @@ -45,13 +45,13 @@ #ifndef SEASTAR_MODULE #include -#include +#include #include #endif namespace seastar { -using rss_key_type = std::basic_string_view; +using rss_key_type = std::span; // Mellanox Linux's driver key static constexpr uint8_t default_rsskey_40bytes_v[] = {