From 2ac1bc84d71fbfc17b9f0571bc6da93c960eaedf Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 30 May 2017 17:15:37 +0200 Subject: [PATCH] text-utils: use proper paths to term.h Signed-off-by: Karel Zak --- term-utils/setterm.c | 15 ++++++--------- text-utils/more.c | 8 +++++++- text-utils/pg.c | 14 ++++++++++++-- text-utils/ul.c | 9 ++++++++- 4 files changed, 33 insertions(+), 13 deletions(-) diff --git a/term-utils/setterm.c b/term-utils/setterm.c index 8e969c2b3..53826f954 100644 --- a/term-utils/setterm.c +++ b/term-utils/setterm.c @@ -60,16 +60,13 @@ #include #include -#ifndef NCURSES_CONST -# define NCURSES_CONST const /* define before including term.h */ +#ifdef HAVE_TERM_H +# include +#elif defined(HAVE_NCURSES_TERM_H) +# include +#elif defined(HAVE_NCURSESW_TERM_H) +# include #endif -#ifdef HAVE_NCURSES_H -# include -#elif defined(HAVE_NCURSES_NCURSES_H) -# include -#endif -/* must include after ncurses.h */ -#include #ifdef HAVE_LINUX_TIOCL_H # include diff --git a/text-utils/more.c b/text-utils/more.c index d4aba11e4..cc53075f6 100644 --- a/text-utils/more.c +++ b/text-utils/more.c @@ -190,7 +190,13 @@ static struct { } context, screen_start; extern char PC; /* pad character */ -#include /* include after */ +#ifdef HAVE_TERM_H +# include +#elif defined(HAVE_NCURSES_TERM_H) +# include +#elif defined(HAVE_NCURSESW_TERM_H) +# include +#endif #define TERM_AUTO_RIGHT_MARGIN "am" #define TERM_CEOL "xhp" diff --git a/text-utils/pg.c b/text-utils/pg.c index b05ec3d70..bc485e2fe 100644 --- a/text-utils/pg.c +++ b/text-utils/pg.c @@ -59,13 +59,23 @@ #include #include -#ifdef HAVE_NCURSES_H +#ifdef HAVE_NCURSESW_H +# include +#elif defined(HAVE_NCURSES_H) # include +#elif defined(HAVE_NCURSESW_NCURSES_H) +# include #elif defined(HAVE_NCURSES_NCURSES_H) # include #endif -#include +#ifdef HAVE_TERM_H +# include +#elif defined(HAVE_NCURSES_TERM_H) +# include +#elif defined(HAVE_NCURSESW_TERM_H) +# include +#endif #include "nls.h" #include "xalloc.h" diff --git a/text-utils/ul.c b/text-utils/ul.c index 178d5cb7f..3d1518cea 100644 --- a/text-utils/ul.c +++ b/text-utils/ul.c @@ -43,13 +43,20 @@ #include #include /* for getopt(), isatty() */ #include /* for memset(), strcpy() */ -#include /* for setupterm() */ #include /* for getenv() */ #include /* for INT_MAX */ #include /* for signal() */ #include #include +#ifdef HAVE_TERM_H +# include +#elif defined(HAVE_NCURSES_TERM_H) +# include +#elif defined(HAVE_NCURSESW_TERM_H) +# include +#endif + #include "nls.h" #include "xalloc.h" #include "widechar.h"