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"