#ifndef TERMUTIL_H #define TERMUTIL_H #ifdef LINUX_BUILD // FIXME: is this ever false? bool TemporaryTerminal () { return false; } #else #include #include #include bool TemporaryTerminal () { CONSOLE_SCREEN_BUFFER_INFO csbi; HANDLE hStdOutput; hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); if (!GetConsoleScreenBufferInfo(hStdOutput, &csbi)) { printf("GetConsoleScreenBufferInfo failed: %d\n", GetLastError()); return false; } return ((!csbi.dwCursorPosition.X) && (!csbi.dwCursorPosition.Y)); }; #endif // LINUX_BUILD #endif