summaryrefslogtreecommitdiffstats
path: root/term-utils/setterm.c
diff options
context:
space:
mode:
authorMike Frysinger2013-09-29 06:44:36 +0200
committerKarel Zak2013-09-30 13:41:03 +0200
commitbfc4331b14ba15883951deac3f650461c6322714 (patch)
treee474b680ada0e8f2c9fe0f18363d026205343be1 /term-utils/setterm.c
parentfindmnt: always allocate memory for cell value (diff)
downloadkernel-qcow2-util-linux-bfc4331b14ba15883951deac3f650461c6322714.tar.gz
kernel-qcow2-util-linux-bfc4331b14ba15883951deac3f650461c6322714.tar.xz
kernel-qcow2-util-linux-bfc4331b14ba15883951deac3f650461c6322714.zip
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 <vapier@gentoo.org>
Diffstat (limited to 'term-utils/setterm.c')
-rw-r--r--term-utils/setterm.c5
1 files changed, 3 insertions, 2 deletions
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 <termios.h>
#include <string.h>
#include <fcntl.h>
+
#ifndef NCURSES_CONST
#define NCURSES_CONST const /* define before including term.h */
#endif
-#include <term.h>
-
#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>
#include <sys/param.h> /* for MAXPATHLEN */
#include <sys/ioctl.h>