260804.1 · 8b661eb3d5ec3323bb88036318c7415fed80b6c9
MinGW portability fixes
- see also #553
- distinct OS_WIN versus OS_WIN_MINGW is necessary, since MinGW is almost windows but not quite, so most changes are for #ifdef checks with a few code blocks moved (no new logic)
- tested with MinGW-w64 UCRT64 with MSYS2 GCC 16.1
- updated verify.sh runs with 'make test' skips directory searches for MinGW, because of the lack of symlink support
- appease -Wunused
reading declarations
Changes to src/vkey.cpp. All files
@@ -746,7 +746,7 @@ void VKey::flush() keybuf[1] = 0; keybuf[2] = 0; -#ifdef OS_WIN+#ifdef OS_WIN_OR_MINGW FlushConsoleInputBuffer(hConIn); @@ -761,7 +761,7 @@ void VKey::flush() // setup vkey in VKey::NORMAL tty or VKey::TTYRAW raw tty mode (cfmakeraw), returns 0 on success <0 on failure bool VKey::setup(int mode) {-#ifdef OS_WIN+#ifdef OS_WIN_OR_MINGW hConIn = CreateFileA("CONIN$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); @@ -837,7 +837,7 @@ bool VKey::setup(int mode) // release vkey resources and restore tty void VKey::cleanup() {-#ifdef OS_WIN+#ifdef OS_WIN_OR_MINGW if (hConIn != INVALID_HANDLE_VALUE) {@@ -898,7 +898,7 @@ void VKey::map_fn_key(unsigned num, const char *keys) } } -#ifdef OS_WIN+#ifdef OS_WIN_OR_MINGW // Windows console state HANDLE VKey::hConIn;