Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support libc++ 19 #173

Merged
merged 4 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/seastar/core/sstring.hh
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ public:
}
}
int compare(std::basic_string_view<char_type, traits_type> 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;
}
Expand All @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions include/seastar/net/toeplitz.hh
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@

#ifndef SEASTAR_MODULE
#include <cstdint>
#include <string_view>
#include <span>
#include <vector>
#endif

namespace seastar {

using rss_key_type = std::basic_string_view<uint8_t>;
using rss_key_type = std::span<const uint8_t>;

// Mellanox Linux's driver key
static constexpr uint8_t default_rsskey_40bytes_v[] = {
Expand Down
12 changes: 6 additions & 6 deletions src/net/ossl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ class tls::certificate_credentials::impl {
}

static x509_ptr parse_x509_cert(const blob& b, x509_crt_format fmt) {
bio_ptr cert_bio(BIO_new_mem_buf(b.begin(), b.size()));
bio_ptr cert_bio(BIO_new_mem_buf(b.data(), b.size()));
x509_ptr cert;
switch(fmt) {
case tls::x509_crt_format::PEM:
Expand All @@ -385,7 +385,7 @@ class tls::certificate_credentials::impl {
}

void set_x509_trust(const blob& b, x509_crt_format fmt) {
bio_ptr cert_bio(BIO_new_mem_buf(b.begin(), b.size()));
bio_ptr cert_bio(BIO_new_mem_buf(b.data(), b.size()));
x509_ptr cert;
switch(fmt) {
case tls::x509_crt_format::PEM:
Expand All @@ -407,7 +407,7 @@ class tls::certificate_credentials::impl {
}

void set_x509_crl(const blob& b, x509_crt_format fmt) {
bio_ptr cert_bio(BIO_new_mem_buf(b.begin(), b.size()));
bio_ptr cert_bio(BIO_new_mem_buf(b.data(), b.size()));
x509_crl_ptr crl;
switch(fmt) {
case x509_crt_format::PEM:
Expand All @@ -432,7 +432,7 @@ class tls::certificate_credentials::impl {

void set_x509_key(const blob& cert, const blob& key, x509_crt_format fmt) {
x509_ptr x509_cert{nullptr};
bio_ptr key_bio(BIO_new_mem_buf(key.begin(), key.size()));
bio_ptr key_bio(BIO_new_mem_buf(key.data(), key.size()));
evp_pkey_ptr pkey;
switch(fmt) {
case x509_crt_format::PEM:
Expand All @@ -441,7 +441,7 @@ class tls::certificate_credentials::impl {
// for this situation. So we will parse through the blob using `iterate_pem_certs`.
// The first cert encountered will be assigned to x509_cert and all subsequent certs
// will be added to the X509_STORE's trusted certificates
iterate_pem_certs(bio_ptr{BIO_new_mem_buf(cert.begin(), cert.size())}, [this, &x509_cert](X509_INFO* info) {
iterate_pem_certs(bio_ptr{BIO_new_mem_buf(cert.data(), cert.size())}, [this, &x509_cert](X509_INFO* info) {
if (!info->x509) {
throw make_ossl_error("Failed to parse X.509 certificate in loading key/cert chain");
}
Expand Down Expand Up @@ -475,7 +475,7 @@ class tls::certificate_credentials::impl {

void set_simple_pkcs12(const blob& b, x509_crt_format, const sstring& password) {
// Load the PKCS12 file
bio_ptr bio(BIO_new_mem_buf(b.begin(), b.size()));
bio_ptr bio(BIO_new_mem_buf(b.data(), b.size()));
if (auto p12 = pkcs12(d2i_PKCS12_bio(bio.get(), nullptr))) {
// Extract the certificate and private key from PKCS12, using provided password
EVP_PKEY *pkey = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion src/util/log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,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);
}
}

Expand Down
Loading