1
0
mirror of https://github.com/irssi/irssi.git synced 2024-06-09 06:20:45 +00:00

Add a check for term.h

If term.h is present, use that instead of defining prototypes for the
terminfo functions in terminfo-core.c. This causes problems on certain
platforms (e.g. Apple aarch64) due to the functions being prototyped as
non-variadic but called as variadic. If term.h isn't found, it falls
back to the old behaviour.

Fixes #1238.
This commit is contained in:
Misty De Meo 2021-03-26 19:20:22 -07:00
parent 6f38095cd6
commit 0b82f14151
No known key found for this signature in database
GPG Key ID: 76CF846A2F674B2C
3 changed files with 10 additions and 0 deletions

View File

@ -355,6 +355,10 @@ if test "x$want_textui" != "xno"; then
AC_SUBST(TEXTUI_LIBS)
LIBS="$TEXTUI_NO_LIBS"
AC_CHECK_HEADER([term.h], [
AC_DEFINE(HAVE_TERM_H, [], [Define to 1 if you have the `term.h' header.])
])
fi
dnl **

View File

@ -525,6 +525,7 @@ headers = [
'sys/time.h',
'sys/utsname.h',
'dirent.h',
'term.h',
'unistd.h',
]
foreach h : headers

View File

@ -12,6 +12,9 @@ inline static int term_putchar(int c)
return fputc(c, current_term->out);
}
#ifdef HAVE_TERM_H
#include <term.h>
#else
/* Don't bother including curses.h because of these -
they might not even be defined there */
char *tparm();
@ -21,6 +24,8 @@ int setupterm();
char *tigetstr();
int tigetnum();
int tigetflag();
#endif
#define term_getstr(x, buffer) tigetstr(x.ti_name)
#define term_getnum(x) tigetnum(x.ti_name);
#define term_getflag(x) tigetflag(x.ti_name);