urnathan / libcody

Compiler/BuildSystem Interface Library
Apache License 2.0
24 stars 6 forks source link

Fix libcody not working with C++20 project #26

Closed LHLaurini closed 3 years ago

LHLaurini commented 3 years ago

Since C++20, the type of u8"..." is const char8_t[N], not const char[N].

urnathan commented 3 years ago

Thank you for the report, but this cannot be the correct fix. (a) what about the other u8 strings, and calls to S2C? (b) The use of utf here is to separate the serialization character set from the source and execution character sets. Removing the u8 prefix negates that.

LHLaurini commented 3 years ago

Here's the thing: the library itself is compiled with C++11, so the only needed change is to the header.

Alternatively, I can move MessageBuffer::Space to messagebuffer.cc and the prefix can stay.

LHLaurini commented 3 years ago

Is this better?

urnathan commented 3 years ago

yes, thanks. I don't think stopping that function being inlineable is a major loss. I think we can move the S2C handling out of the user-facing header entirely.