diff --git a/CHANGELOG.md b/CHANGELOG.md index d9f4a87..398f4a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,10 @@ The scope of what is covered by the version number excludes: ## Version history +### unreleased + +- Chore: add compiler error on Windows if Virtual Terminal Processing is unavailable. + ### Version 0.4.2, released 25-Jun-2024 - Fix: include additional headers for some MinGW installations diff --git a/src/term.c b/src/term.c index 1bb6c75..e1f2f9c 100644 --- a/src/term.c +++ b/src/term.c @@ -107,6 +107,11 @@ typedef struct ls_RegConst { // This is needed because some flags are not defined on all platforms. So we // still export the constants, but they will be all 0, and hence not do anything. #ifdef _WIN32 +// check compatibility: Windows virtual terminal processing was added in 2019, +// so requires MS toolchain 2022 or newer. +#ifndef ENABLE_VIRTUAL_TERMINAL_INPUT +#error 2019 and older toolchains are not supported. Update the toolchain or revert to Luasystem < 0.4 +#endif #define CHECK_WIN_FLAG_OR_ZERO(flag) flag #define CHECK_NIX_FLAG_OR_ZERO(flag) 0 #else