mirror of
https://github.com/AdaCore/cvc5.git
synced 2026-02-12 12:32:16 -08:00
This PR introduces the new C++ methods `Term TermManager::mkString(const std::u32string& s)` and `std::u32string Term::getU32StringValue()` to replace old methods `Term TermManager::mkString(const std::wstring& s)` and `std::wstring Term::getStringValue()`. The reason for this change is that `wchar_t` has a platform-dependent size: on Windows, it is 16-bit (UTF-16), while on Linux and macOS, it is 32-bit (UTF-32). However, the current implementation assumes that `wchar_t` is always 32 bits. In contrast, `char32_t` and `std::u32string` are explicitly designed for Unicode and have consistent 32-bit size across platforms. Similarly, this PR also introduces C functions `cvc5_mk_string_from_char32` and `cvc5_term_get_u32string_value` to replace old functions `cvc5_mk_string_from_wchar` and `cvc5_term_get_string_value`. Although `char32_t` is part of the C11 standard, the `<uchar.h>` header (which should define `char32_t`) is missing in Apple Clang. Therefore, we explicitly provide a definition in such cases. --------- Co-authored-by: Aina Niemetz <aina.niemetz@gmail.com>
14 KiB
14 KiB