mirror of https://github.com/xzeldon/htop.git
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:
parent
0580dbb202
commit
9579d9b7aa
8
CRT.c
8
CRT.c
|
@ -886,6 +886,10 @@ void CRT_init(const Settings* settings, bool allowUnicode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (termType && (String_startsWith(termType, "xterm") || String_eq(termType, "vt220"))) {
|
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[H", KEY_HOME);
|
||||||
define_key("\033[F", KEY_END);
|
define_key("\033[F", KEY_END);
|
||||||
define_key("\033[7~", KEY_HOME);
|
define_key("\033[7~", KEY_HOME);
|
||||||
|
@ -906,6 +910,10 @@ void CRT_init(const Settings* settings, bool allowUnicode) {
|
||||||
sequence[1] = c;
|
sequence[1] = c;
|
||||||
define_key(sequence, KEY_ALT('A' + (c - 'a')));
|
define_key(sequence, KEY_ALT('A' + (c - 'a')));
|
||||||
}
|
}
|
||||||
|
#ifdef HTOP_NETBSD
|
||||||
|
IGNORE_WCASTQUAL_END
|
||||||
|
#undef define_key
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
CRT_installSignalHandlers();
|
CRT_installSignalHandlers();
|
||||||
|
|
Loading…
Reference in New Issue