Rework curses detection

Detect diffrent variants of curses and use them.
This commit is contained in:
Anton Lundin
2012-11-29 23:35:53 +01:00
parent 70a7c8024a
commit 993abf57f1
4 changed files with 578 additions and 14 deletions
+13 -1
View File
@@ -42,7 +42,19 @@
#include "fatal_assert.h"
/* these need to be included last because of conflicting defines */
#include <curses.h>
#if defined HAVE_NCURSESW_CURSES_H
# include <ncursesw/curses.h>
#elif defined HAVE_NCURSESW_H
# include <ncursesw.h>
#elif defined HAVE_NCURSES_CURSES_H
# include <ncurses/curses.h>
#elif defined HAVE_NCURSES_H
# include <ncurses.h>
#elif defined HAVE_CURSES_H
# include <curses.h>
#else
# error "SysV or X/Open-compatible Curses header file required"
#endif
#include <term.h>
void usage( const char *argv0 ) {
+14 -1
View File
@@ -33,11 +33,24 @@
/* This is in its own file because otherwise the ncurses #defines
alias our own variable names. */
#include "config.h"
#include "terminaldisplay.h"
#include <string>
#include <curses.h>
#if defined HAVE_NCURSESW_CURSES_H
# include <ncursesw/curses.h>
#elif defined HAVE_NCURSESW_H
# include <ncursesw.h>
#elif defined HAVE_NCURSES_CURSES_H
# include <ncurses/curses.h>
#elif defined HAVE_NCURSES_H
# include <ncurses.h>
#elif defined HAVE_CURSES_H
# include <curses.h>
#else
# error "SysV or X/Open-compatible Curses header file required"
#endif
#include <term.h>
#include <stdlib.h>
#include <string.h>