mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2025-01-11 19:21:46 +00:00
Disable _O_WTEXT when using main in MinGW
This commit is contained in:
parent
602c748863
commit
5dc35d3b59
@ -594,7 +594,11 @@ void console_init(console_state & con_st) {
|
|||||||
HANDLE hConIn = GetStdHandle(STD_INPUT_HANDLE);
|
HANDLE hConIn = GetStdHandle(STD_INPUT_HANDLE);
|
||||||
if (hConIn != INVALID_HANDLE_VALUE && GetConsoleMode(hConIn, &dwMode)) {
|
if (hConIn != INVALID_HANDLE_VALUE && GetConsoleMode(hConIn, &dwMode)) {
|
||||||
// Set console input codepage to UTF16
|
// Set console input codepage to UTF16
|
||||||
|
#ifdef __MINGW32__ /* UTF16 requires wmain in MinGW */
|
||||||
|
_setmode(_fileno(stdin), _O_TEXT);
|
||||||
|
#else
|
||||||
_setmode(_fileno(stdin), _O_WTEXT);
|
_setmode(_fileno(stdin), _O_WTEXT);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Turn off ICANON (ENABLE_LINE_INPUT) and ECHO (ENABLE_ECHO_INPUT)
|
// Turn off ICANON (ENABLE_LINE_INPUT) and ECHO (ENABLE_ECHO_INPUT)
|
||||||
dwMode &= ~(ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT);
|
dwMode &= ~(ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT);
|
||||||
|
Loading…
Reference in New Issue
Block a user