Merge pull request #1290 from mistydemeo/check_for_term_h

Add a check for term.h

(cherry picked from commit a7315250128ad93ac03ceed4b8ee91833f3f3d3e)
This commit is contained in:
ailin-nemui 2021-04-01 21:28:04 +02:00 committed by Ailin Nemui
parent ef124d7378
commit 11905badcb
2 changed files with 9 additions and 0 deletions

View File

@ -368,6 +368,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

@ -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);