From 9bae7d230cd5db891b0632f92d03d236a6e02754 Mon Sep 17 00:00:00 2001 From: Daria Phoebe Brashear Date: Tue, 24 Oct 2017 13:01:47 -0400 Subject: [PATCH] libedit: provide stub curses when none found for cross-compiling for a GUI, being able to build the whole tree despite having no curses is helpful; provide an interface which just fails all calls --- lib/libedit/src/terminal.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/libedit/src/terminal.c b/lib/libedit/src/terminal.c index 26838e813..5d2271f8c 100644 --- a/lib/libedit/src/terminal.c +++ b/lib/libedit/src/terminal.c @@ -216,6 +216,15 @@ static pthread_mutex_t terminal_mutex = PTHREAD_MUTEX_INITIALIZER; #endif static FILE *terminal_outfile = NULL; +#ifndef HAVE_TGETENT +/* provide a stub curses which fails all calls if we have no tgetent et al */ +#define tgoto(x, y, z) (char *)0 +#define tgetstr(x, y) (char *)0 +#define tgetent(x, y) -1; +#define tputs(x, y, z) -1 +#define tgetflag(x) -1 +#define tgetnum(x) -1 +#endif /* terminal_setflags(): * Set the terminal capability flags