]> git.ipfire.org Git - thirdparty/gcc.git/commit
libcody: Make it buildable by C++11 to C++26
authorJakub Jelinek <jakub@redhat.com>
Fri, 21 Nov 2025 15:25:58 +0000 (16:25 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 21 Nov 2025 15:25:58 +0000 (16:25 +0100)
commit07a767c7a50d1daae8ef7d4aba73fe53ad40c0b7
treea64c4f1dd5f1fcf9a078cdc42747db3221306219
parent9dff0355c75d70d2a7583b626426599ee054406a
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.
libcody/client.cc
libcody/cody.hh
libcody/server.cc