From 381b82ee4e59bef125282d8ce5474812d0ebc345 Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Tue, 3 Dec 2024 06:08:25 -0500 Subject: [PATCH] Small fix to build on non-windows platforms. --- scratchpad/img2ansi.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scratchpad/img2ansi.cpp b/scratchpad/img2ansi.cpp index 0c5ddad..b24ae0d 100644 --- a/scratchpad/img2ansi.cpp +++ b/scratchpad/img2ansi.cpp @@ -11,7 +11,9 @@ #include #include #include -#include +#if defined(_WIN64) || defined(_WIN32) + #include +#endif #include using namespace std::chrono_literals; @@ -67,7 +69,10 @@ HSVColor rgb_to_hsv(sf::Color rgb) { int main(int argc, char *argv[]) { ftxui::Terminal::SetColorSupport(ftxui::Terminal::Color::TrueColor); +#if defined(_WIN64) || defined(_WIN32) _setmode(_fileno(stdout), _O_U16TEXT); +#endif + dbc::check(argc == 2, "USAGE: img2ansi "); string image_file(argv[1]);