aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2024-12-23 11:13:19 -0800
committerGitHub <noreply@github.com>2024-12-23 11:13:19 -0800
commitffaab09e998678ba2309821300ac10d62f3d3a78 (patch)
tree180472166a1bccd6cf6e3794f5d53c8e3d3b5365
parentd74c74aae35e79591426bac786a02c8b008cef5d (diff)
downloadrneovim-ffaab09e998678ba2309821300ac10d62f3d3a78.tar.gz
rneovim-ffaab09e998678ba2309821300ac10d62f3d3a78.tar.bz2
rneovim-ffaab09e998678ba2309821300ac10d62f3d3a78.zip
fix(build): <termios.h> is system-dependent #31705
Problem: Since 2a7d0ed6145bf3f8b139c2694563f460f829813a, build fails with glibc version 2.28 / RHEL8 (where `termios.h` does not include unistd.h and is therefore missing `_POSIX_VDISABLE`): …/src/nvim/tui/termkey/termkey.c: In function 'termkey_start': …/src/nvim/tui/termkey/termkey.c:516:31: error: '_POSIX_VDISABLE' undeclared (first use in this function) 516 | termios.c_cc[VQUIT] = _POSIX_VDISABLE; | ^~~~~~~~~~~~~~~ …/src/nvim/tui/termkey/termkey.c:516:31: note: each undeclared identifier is reported only once for each function it appears in Solution: - Undo the `<termios.h>` change and mark the imports with `IWYU pragma: keep`.
-rw-r--r--src/nvim/tui/termkey/termkey.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/tui/termkey/termkey.c b/src/nvim/tui/termkey/termkey.c
index 8fdaa1d4f4..f5736e9b69 100644
--- a/src/nvim/tui/termkey/termkey.c
+++ b/src/nvim/tui/termkey/termkey.c
@@ -13,7 +13,10 @@
#include "nvim/tui/termkey/termkey_defs.h"
#ifndef _WIN32
-# include <termios.h>
+// Include these directly instead of <termios.h> which is system-dependent. #31704
+# include <poll.h> // IWYU pragma: keep
+# include <strings.h> // IWYU pragma: keep
+# include <unistd.h> // IWYU pragma: keep
#else
# include <io.h>
#endif