diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index 553e7ce88d4b8..cc45c377e99fd 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -19,8 +19,16 @@ #endif #ifdef _WIN32 +#if !defined(FMT_WINDOWS_NO_WCHAR) && \ + (!FMT_HAS_INCLUDE() || (defined(WINVER) && WINVER <= 0x0500 && !defined(_WIN32_WINNT))) +// A legacy Windows platform without wide char APIs, e.g. Windows 98, original Xbox. +#define FMT_WINDOWS_NO_WCHAR +#endif + +#ifndef FMT_WINDOWS_NO_WCHAR # include // _isatty #endif +#endif #include "format.h" @@ -1426,7 +1434,7 @@ FMT_FUNC std::string vformat(string_view fmt, format_args args) { } namespace detail { -#ifndef _WIN32 +#if !defined(_WIN32) || defined(FMT_WINDOWS_NO_WCHAR) FMT_FUNC bool write_console(std::FILE*, string_view) { return false; } #else using dword = conditional_t;