From 7573de8a61b4283371d3d561b80b1df83ac77376 Mon Sep 17 00:00:00 2001 From: Aaron Liu Date: Wed, 6 Dec 2023 20:38:24 -0500 Subject: [PATCH] fix a stupid typo and clarify windows error code --- src/tiv.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/tiv.cpp b/src/tiv.cpp index 421eb7e..cef3516 100644 --- a/src/tiv.cpp +++ b/src/tiv.cpp @@ -563,7 +563,7 @@ int main(int argc, char *argv[]) { // implementations are welcome Fallback sizes when unsuccesful int maxWidth = 80; int maxHeight = 24; -#ifdef __POSIX_VERSION +#ifdef _POSIX_VERSION struct winsize w; // If redirecting STDOUT to one file ( col or row == 0, or the previous // ioctl call's failed ) @@ -584,10 +584,9 @@ int main(int argc, char *argv[]) { maxWidth = w.dwSize.X * 4; maxHeight = w.dwSize.Y * 8; } else { - std::cerr << GetLastError(); - std::cerr << "Warning: failed to determine most reasonable size, " - "defaulting to 80x24" - << std::endl; + std::cerr + << "Warning: failed to determine most reasonable size: Error code" + << GetLastError() << ", defaulting to 80x24" << std::endl; } #else std::cerr << "Warning: failed to determine most reasonable size: "