diff options
author | Victor Zverovich <viz@meta.com> | 2024-05-11 20:02:22 -0700 |
---|---|---|
committer | Victor Zverovich <viz@meta.com> | 2024-05-11 20:02:22 -0700 |
commit | db1ee420e09d5c23767d72e63bb44934a85414d9 (patch) | |
tree | 8548c9900e362ba503013da7e9697fc64b1f63c6 | |
parent | 7d6ae972b982b9e660d0a272e5ed00d163f25bfe (diff) | |
download | fmtlib-db1ee420e09d5c23767d72e63bb44934a85414d9.tar.gz |
Cleanup unicode check more
-rw-r--r-- | include/fmt/base.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/fmt/base.h b/include/fmt/base.h index 1f00f5ec..a9ae1f51 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -427,9 +427,11 @@ constexpr auto is_utf8_enabled() -> bool { return sizeof("\u00A7") == 3 && uchar("\u00A7"[0]) == 0xC2 && uchar("\u00A7"[1]) == 0xA7; } -constexpr auto use_utf8() -> bool { return FMT_UNICODE || is_utf8_enabled(); } +constexpr auto use_utf8() -> bool { + return !FMT_MSC_VERSION || is_utf8_enabled(); +} -static_assert(!(FMT_UNICODE && FMT_MSC_VERSION && !is_utf8_enabled()), +static_assert(!FMT_UNICODE || use_utf8(), "Unicode support requires compiling with /utf-8"); template <typename Char> FMT_CONSTEXPR auto length(const Char* s) -> size_t { |