summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--term-utils/setterm.c15
-rw-r--r--text-utils/more.c8
-rw-r--r--text-utils/pg.c14
-rw-r--r--text-utils/ul.c9
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 <termios.h>
#include <unistd.h>
-#ifndef NCURSES_CONST
-# define NCURSES_CONST const /* define before including term.h */
+#ifdef HAVE_TERM_H
+# include <term.h>
+#elif defined(HAVE_NCURSES_TERM_H)
+# include <ncurses/term.h>
+#elif defined(HAVE_NCURSESW_TERM_H)
+# include <ncursesw/term.h>
#endif
-#ifdef HAVE_NCURSES_H
-# include <ncurses.h>
-#elif defined(HAVE_NCURSES_NCURSES_H)
-# include <ncurses/ncurses.h>
-#endif
-/* must include after ncurses.h */
-#include <term.h>
#ifdef HAVE_LINUX_TIOCL_H
# include <linux/tiocl.h>
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 <term.h> /* include after <curses.h> */
+#ifdef HAVE_TERM_H
+# include <term.h>
+#elif defined(HAVE_NCURSES_TERM_H)
+# include <ncurses/term.h>
+#elif defined(HAVE_NCURSESW_TERM_H)
+# include <ncursesw/term.h>
+#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 <signal.h>
#include <setjmp.h>
-#ifdef HAVE_NCURSES_H
+#ifdef HAVE_NCURSESW_H
+# include <ncursesw.h>
+#elif defined(HAVE_NCURSES_H)
# include <ncurses.h>
+#elif defined(HAVE_NCURSESW_NCURSES_H)
+# include <ncursesw/ncurses.h>
#elif defined(HAVE_NCURSES_NCURSES_H)
# include <ncurses/ncurses.h>
#endif
-#include <term.h>
+#ifdef HAVE_TERM_H
+# include <term.h>
+#elif defined(HAVE_NCURSES_TERM_H)
+# include <ncurses/term.h>
+#elif defined(HAVE_NCURSESW_TERM_H)
+# include <ncursesw/term.h>
+#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 <stdio.h>
#include <unistd.h> /* for getopt(), isatty() */
#include <string.h> /* for memset(), strcpy() */
-#include <term.h> /* for setupterm() */
#include <stdlib.h> /* for getenv() */
#include <limits.h> /* for INT_MAX */
#include <signal.h> /* for signal() */
#include <errno.h>
#include <getopt.h>
+#ifdef HAVE_TERM_H
+# include <term.h>
+#elif defined(HAVE_NCURSES_TERM_H)
+# include <ncurses/term.h>
+#elif defined(HAVE_NCURSESW_TERM_H)
+# include <ncursesw/term.h>
+#endif
+
#include "nls.h"
#include "xalloc.h"
#include "widechar.h"