gnu /
gcc /
1f0224e8ddb3d3d0bf4c7a11769b193a4df5cc37 libcody: Make it buildable by C++11 to C++26
The following builds with -std=c++11 and c++14 and c++17 and c++20 and c++23
and c++26.
I see the u8 string literals are mixed e.g. with strerror, so in
-fexec-charset=IBM1047 there will still be garbage, so am not 100% sure if
the u8 literals everywhere are worth it either.
2025-11-21 Jakub Jelinek <jakub@redhat.com>
* cody.hh (S2C): For __cpp_char8_t >= 201811 use char8_t instead of
char in argument type.
(MessageBuffer::Space): Revert 2025-11-15 change.
(MessageBuffer::Append): For __cpp_char8_t >= 201811 add overload
with char8_t const * type of first argument.
(Packet::Packet): Similarly for first argument.
* client.cc (CommunicationError, Client::ProcessResponse,
Client::Connect, ConnectResponse, PathnameResponse, OKResponse,
IncludeTranslateResponse): Cast u8 string literals to (const char *)
where needed.
* server.cc (Server::ProcessRequests, ConnectRequest): Likewise.
(cherry picked from commit 07a767c7a50d1daae8ef7d4aba73fe53ad40c0b7)
3 files changed