From bfc4331b14ba15883951deac3f650461c6322714 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 29 Sep 2013 00:44:36 -0400 Subject: setterm: fix term.h/ncurses.h include ordering The ncurses term.h header has logic in it to detect if nucrses.h has already been included and void defining things when it has. But since setterm includes term.h and the ncurses.h, it doesn't work and we can get fun build-time warnings like: CC term-utils/setterm-setterm.o In file included from term-utils/setterm.c:109:0: /usr/include/ncursesw/ncurses.h:827:12: warning: redundant redeclaration of 'tigetflag' [-Wredundant-decls] extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *); /* implemented */ ^ In file included from term-utils/setterm.c:106:0: /usr/include/ncursesw/term.h:775:12: note: previous declaration of 'tigetflag' was here extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *); ^ Signed-off-by: Mike Frysinger --- term-utils/setterm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'term-utils/setterm.c') diff --git a/term-utils/setterm.c b/term-utils/setterm.c index 310c3fab0..d41e335a8 100644 --- a/term-utils/setterm.c +++ b/term-utils/setterm.c @@ -100,16 +100,17 @@ #include #include #include + #ifndef NCURSES_CONST #define NCURSES_CONST const /* define before including term.h */ #endif -#include - #ifdef HAVE_NCURSES_H #include #elif defined(HAVE_NCURSES_NCURSES_H) #include #endif +/* must include after ncurses.h */ +#include #include /* for MAXPATHLEN */ #include -- cgit v1.2.3-55-g7522