some build fixes

This commit is contained in:
2022-01-07 01:58:38 +03:00
parent 3c8ccf357b
commit cbdaabee4a
5 changed files with 7 additions and 5 deletions

View File

@@ -23,6 +23,7 @@
# include <fcntl.h>
# include <termios.h>
#else
# include <wingdi.h>
# include <wincon.h>
# ifndef COMMON_LVB_UNDERSCORE
# define COMMON_LVB_UNDERSCORE 0x8000
@@ -108,16 +109,13 @@ void PIScreen::SystemConsole::end() {
void PIScreen::SystemConsole::prepare() {
int w, h;
int w = 80, h = 24;
#ifdef WINDOWS
GetConsoleScreenBufferInfo(PRIVATE->hOut, &PRIVATE->csbi);
w = PRIVATE->csbi.srWindow.Right - PRIVATE->csbi.srWindow.Left + 1;
h = PRIVATE->csbi.srWindow.Bottom - PRIVATE->csbi.srWindow.Top + 1;
#else
# ifdef FREERTOS
w = 80;
h = 24;
# else
# ifndef FREERTOS
winsize ws;
ioctl(0, TIOCGWINSZ, &ws);
w = ws.ws_col;