[ fix ] fix scheme002 test on windows

This commit is contained in:
Steve Dunham 2023-08-02 08:13:40 -07:00 committed by G. Allais
parent b7bda5e96d
commit dc43ce2056

View File

@ -16,14 +16,18 @@ void idris2_setupTerm() {
int idris2_getTermCols() {
CONSOLE_SCREEN_BUFFER_INFO csbi;
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
return (int)csbi.srWindow.Right - csbi.srWindow.Left + 1;
if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi)) {
return (int)csbi.srWindow.Right - csbi.srWindow.Left + 1;
}
return 0;
}
int idris2_getTermLines() {
CONSOLE_SCREEN_BUFFER_INFO csbi;
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
return (int)csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi)) {
return (int)csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
}
return 0;
}
#else