updated build system

This commit is contained in:
2025-08-28 18:34:21 -05:00
parent c9362b8802
commit fa3419c7cc
12 changed files with 996 additions and 194 deletions

View File

@@ -51,7 +51,7 @@ auto from_utf8(std::string_view str) -> std::wstring {
while (idx < len) {
UChar32 uni_ch{};
U8_NEXT(str_ptr, idx, len, uni_ch);
if (uni_ch < 0 || !U_IS_UNICODE_CHAR(uni_ch)) {
if (uni_ch < 0 || not U_IS_UNICODE_CHAR(uni_ch)) {
throw std::runtime_error("from_utf8: invalid UTF-8 sequence");
}
std::array<UChar, 2U> units{};
@@ -71,7 +71,7 @@ auto from_utf8(std::string_view str) -> std::wstring {
while (idx < len) {
UChar32 uni_ch{};
U8_NEXT(str_ptr, idx, len, uni_ch);
if (uni_ch < 0 || !U_IS_UNICODE_CHAR(uni_ch)) {
if (uni_ch < 0 || not U_IS_UNICODE_CHAR(uni_ch)) {
throw std::runtime_error("from_utf8: invalid UTF-8 sequence");
}
out.push_back(static_cast<wchar_t>(uni_ch));
@@ -183,7 +183,7 @@ auto to_utf8(std::wstring_view str) -> std::string {
while (idx < len) {
UChar32 uni_ch{};
U16_NEXT(u16, idx, len, uni_ch);
if (uni_ch < 0 || !U_IS_UNICODE_CHAR(uni_ch)) {
if (uni_ch < 0 || not U_IS_UNICODE_CHAR(uni_ch)) {
throw std::runtime_error("to_utf8: invalid UTF-16 sequence");
}
std::array<std::uint8_t, U8_MAX_LENGTH> buf{};
@@ -197,9 +197,9 @@ auto to_utf8(std::wstring_view str) -> std::string {
static_cast<std::size_t>(off));
}
#else // WCHAR_MAX > 0xFFFF
for (auto cur_ch : str) {
for (const auto &cur_ch : str) {
auto uni_char{static_cast<UChar32>(cur_ch)};
if (!U_IS_UNICODE_CHAR(uni_char)) {
if (not U_IS_UNICODE_CHAR(uni_char)) {
throw std::runtime_error("to_utf8: invalid Unicode scalar value");
}
std::array<std::uint8_t, U8_MAX_LENGTH> buf{};