NetBSD: silence dropping const qualifier on define_key(3)

On NetBSD define_key(3) has the prototype

    int define_key(char *sequence, int key_symbol);
This commit is contained in:
Christian Göttsche 2021-08-30 19:22:44 +02:00 committed by BenBE
parent 0580dbb202
commit 9579d9b7aa
1 changed files with 8 additions and 0 deletions

8
CRT.c
View File

@ -886,6 +886,10 @@ void CRT_init(const Settings* settings, bool allowUnicode) {
}
if (termType && (String_startsWith(termType, "xterm") || String_eq(termType, "vt220"))) {
#ifdef HTOP_NETBSD
#define define_key(s_, k_) define_key((char*)s_, k_)
IGNORE_WCASTQUAL_BEGIN
#endif
define_key("\033[H", KEY_HOME);
define_key("\033[F", KEY_END);
define_key("\033[7~", KEY_HOME);
@ -906,6 +910,10 @@ void CRT_init(const Settings* settings, bool allowUnicode) {
sequence[1] = c;
define_key(sequence, KEY_ALT('A' + (c - 'a')));
}
#ifdef HTOP_NETBSD
IGNORE_WCASTQUAL_END
#undef define_key
#endif
}
CRT_installSignalHandlers();