Windows: disable stdout buffer

This commit is contained in:
李通洲
2022-12-10 22:21:11 +08:00
parent 24ae7ec6e0
commit 68b98c1bd2
+1 -2
View File
@@ -121,7 +121,6 @@ static void initState(FFstate* state)
#ifdef WIN32
//https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/setlocale-wsetlocale?source=recommendations&view=msvc-170#utf-8-support
setlocale(LC_ALL, ".UTF8");
setvbuf(stdout, NULL, _IOFBF, 4096);
#endif
state->logoWidth = 0;
@@ -359,7 +358,7 @@ void ffStart(FFinstance* instance)
DWORD mode = 0;
GetConsoleMode(hStdout, &mode);
SetConsoleMode(hStdout, mode | ENABLE_PROCESSED_OUTPUT | ENABLE_VIRTUAL_TERMINAL_PROCESSING);
// SetConsoleOutputCP(CP_UTF8);
SetConsoleOutputCP(CP_UTF8);
#else
struct sigaction action = { .sa_handler = exitSignalHandler };
sigaction(SIGINT, &action, NULL);