aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThijs Schreijer <thijs@thijsschreijer.nl>2024-07-31 14:49:07 +0200
committerGitHub <noreply@github.com>2024-07-31 14:49:07 +0200
commit227743a147967bf1418525770082a5943b3f9f41 (patch)
tree56b190f0350eb897f1bb4e39b4019641f7d19480
parent45499248cea9e23b7e4d8478759414e01c645809 (diff)
downloadluasystem-227743a147967bf1418525770082a5943b3f9f41.tar.gz
luasystem-227743a147967bf1418525770082a5943b3f9f41.tar.bz2
luasystem-227743a147967bf1418525770082a5943b3f9f41.zip
chore(term): add descriptive error on Windows for lack of VT (#32)
-rw-r--r--CHANGELOG.md4
-rw-r--r--src/term.c5
2 files changed, 9 insertions, 0 deletions
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:
28 28
29## Version history 29## Version history
30 30
31### unreleased
32
33- Chore: add compiler error on Windows if Virtual Terminal Processing is unavailable.
34
31### Version 0.4.2, released 25-Jun-2024 35### Version 0.4.2, released 25-Jun-2024
32 36
33- Fix: include additional headers for some MinGW installations 37- Fix: include additional headers for some MinGW installations
diff --git a/src/term.c b/src/term.c
index 1bb6c75..e58e190 100644
--- a/src/term.c
+++ b/src/term.c
@@ -107,6 +107,11 @@ typedef struct ls_RegConst {
107// This is needed because some flags are not defined on all platforms. So we 107// This is needed because some flags are not defined on all platforms. So we
108// still export the constants, but they will be all 0, and hence not do anything. 108// still export the constants, but they will be all 0, and hence not do anything.
109#ifdef _WIN32 109#ifdef _WIN32
110// check compatibility: Windows virtual terminal processing was added in 2015,
111// some older compiler suites don't have the proper headers.
112#ifndef ENABLE_VIRTUAL_TERMINAL_INPUT
113#error Virtual terminal macros are undefined (eg. ENABLE_VIRTUAL_TERMINAL_INPUT). Update the toolchain or revert to Luasystem < 0.4
114#endif
110#define CHECK_WIN_FLAG_OR_ZERO(flag) flag 115#define CHECK_WIN_FLAG_OR_ZERO(flag) flag
111#define CHECK_NIX_FLAG_OR_ZERO(flag) 0 116#define CHECK_NIX_FLAG_OR_ZERO(flag) 0
112#else 117#else