Small fix to build on non-windows platforms.

main
Zed A. Shaw 2 days ago
parent c7607533ce
commit 381b82ee4e
  1. 5
      scratchpad/img2ansi.cpp

@ -11,7 +11,9 @@
#include <ftxui/screen/terminal.hpp> #include <ftxui/screen/terminal.hpp>
#include <iostream> #include <iostream>
#include <fcntl.h> #include <fcntl.h>
#if defined(_WIN64) || defined(_WIN32)
#include <io.h> #include <io.h>
#endif
#include <vector> #include <vector>
using namespace std::chrono_literals; using namespace std::chrono_literals;
@ -67,7 +69,10 @@ HSVColor rgb_to_hsv(sf::Color rgb) {
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
ftxui::Terminal::SetColorSupport(ftxui::Terminal::Color::TrueColor); ftxui::Terminal::SetColorSupport(ftxui::Terminal::Color::TrueColor);
#if defined(_WIN64) || defined(_WIN32)
_setmode(_fileno(stdout), _O_U16TEXT); _setmode(_fileno(stdout), _O_U16TEXT);
#endif
dbc::check(argc == 2, "USAGE: img2ansi <image_file>"); dbc::check(argc == 2, "USAGE: img2ansi <image_file>");
string image_file(argv[1]); string image_file(argv[1]);

Loading…
Cancel
Save