diff --git a/builtin_set_color.cpp b/builtin_set_color.cpp index b3757e1c3..76efde82b 100644 --- a/builtin_set_color.cpp +++ b/builtin_set_color.cpp @@ -11,8 +11,13 @@ Functions used for implementing the set_color builtin. #if HAVE_NCURSES_H #include +#elif HAVE_NCURSES_CURSES_H +#include #else +// Solaris curses defines lots of unneeded macros which conflict with C++ +#define NOMACROS #include +#undef NOMACROS #endif #if HAVE_TERM_H diff --git a/common.cpp b/common.cpp index ceb323cb2..db0f76e08 100644 --- a/common.cpp +++ b/common.cpp @@ -45,11 +45,15 @@ parts of fish. #include #endif - #if HAVE_NCURSES_H #include +#elif HAVE_NCURSES_CURSES_H +#include #else +// Solaris curses defines lots of unneeded macros which conflict with C++ +#define NOMACROS #include +#undef NOMACROS #endif #if HAVE_TERM_H diff --git a/configure.ac b/configure.ac index 6c0e32e92..a17166364 100644 --- a/configure.ac +++ b/configure.ac @@ -301,35 +301,6 @@ case $target_os in ;; esac -# Check for Solaris curses tputs having fixed length parameter list. -AC_MSG_CHECKING([if we are using non varargs tparm.]) -AC_COMPILE_IFELSE( - [ - AC_LANG_PROGRAM( - [ - #include - #include - ], - [ - tparm( "" ); - ] - ) - ], - [tparm_solaris_kludge=no], - [tparm_solaris_kludge=yes] -) -if test "x$tparm_solaris_kludge" = "xyes"; then - AC_MSG_RESULT(yes) - AC_DEFINE( - [TPARM_SOLARIS_KLUDGE], - [1], - [Define to 1 if tparm accepts a fixed amount of paramters.] - ) -else - AC_MSG_RESULT(no) -fi - - # # BSD-specific flags go here # @@ -390,7 +361,7 @@ fi # Check presense of various header files # -AC_CHECK_HEADERS([getopt.h termios.h sys/resource.h term.h ncurses/term.h ncurses.h curses.h stropts.h siginfo.h sys/select.h sys/ioctl.h execinfo.h spawn.h sys/sysctl.h]) +AC_CHECK_HEADERS([getopt.h termios.h sys/resource.h term.h ncurses/term.h ncurses.h ncurses/curses.h curses.h stropts.h siginfo.h sys/select.h sys/ioctl.h execinfo.h spawn.h sys/sysctl.h]) if test x$local_gettext != xno; then AC_CHECK_HEADERS([libintl.h]) @@ -748,6 +719,43 @@ else AC_MSG_RESULT(no) fi +# Check for Solaris curses tputs having fixed length parameter list. +AC_MSG_CHECKING([if we are using non varargs tparm.]) +AC_COMPILE_IFELSE( + [ + AC_LANG_PROGRAM( + [ + #if HAVE_NCURSES_H + #include + #else + #include + #endif + + #if HAVE_TERM_H + #include + #elif HAVE_NCURSES_TERM_H + #include + #endif + ], + [ + tparm( "" ); + ] + ) + ], + [tparm_solaris_kludge=no], + [tparm_solaris_kludge=yes] +) +if test "x$tparm_solaris_kludge" = "xyes"; then + AC_MSG_RESULT(yes) + AC_DEFINE( + [TPARM_SOLARIS_KLUDGE], + [1], + [Define to 1 if tparm accepts a fixed amount of paramters.] + ) +else + AC_MSG_RESULT(no) +fi + # Tell the world what we know AC_CONFIG_FILES([Makefile]) AC_OUTPUT diff --git a/env.cpp b/env.cpp index 996784558..1e63a335b 100644 --- a/env.cpp +++ b/env.cpp @@ -21,8 +21,13 @@ #if HAVE_NCURSES_H #include +#elif HAVE_NCURSES_CURSES_H +#include #else +// Solaris curses defines lots of unneeded macros which conflict with C++ +#define NOMACROS #include +#undef NOMACROS #endif #if HAVE_TERM_H diff --git a/fallback.cpp b/fallback.cpp index d69d76f4c..1a87a0927 100644 --- a/fallback.cpp +++ b/fallback.cpp @@ -32,8 +32,13 @@ #if HAVE_NCURSES_H #include +#elif HAVE_NCURSES_CURSES_H +#include #else +// Solaris curses defines lots of unneeded macros which conflict with C++ +#define NOMACROS #include +#undef NOMACROS #endif #if HAVE_TERM_H diff --git a/input.cpp b/input.cpp index 8eeb44779..b4e323e95 100644 --- a/input.cpp +++ b/input.cpp @@ -24,8 +24,13 @@ #if HAVE_NCURSES_H #include +#elif HAVE_NCURSES_CURSES_H +#include #else +// Solaris curses defines lots of unneeded macros which conflict with C++ +#define NOMACROS #include +#undef NOMACROS #endif #if HAVE_TERM_H diff --git a/io.cpp b/io.cpp index 57ce43d3c..56cb63b6d 100644 --- a/io.cpp +++ b/io.cpp @@ -24,8 +24,13 @@ Utilities for io redirection. #if HAVE_NCURSES_H #include +#elif HAVE_NCURSES_CURSES_H +#include #else +// Solaris curses defines lots of unneeded macros which conflict with C++ +#define NOMACROS #include +#undef NOMACROS #endif #if HAVE_TERM_H diff --git a/osx/config.h b/osx/config.h index 99f837427..8a29644ae 100644 --- a/osx/config.h +++ b/osx/config.h @@ -61,6 +61,9 @@ /* Define to 1 if you have the nan function */ #define HAVE_NAN 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NCURSES_CURSES_H */ + /* Define to 1 if you have the header file. */ #define HAVE_NCURSES_H 1 diff --git a/output.cpp b/output.cpp index 6144746ab..7be8954d3 100644 --- a/output.cpp +++ b/output.cpp @@ -22,8 +22,13 @@ #if HAVE_NCURSES_H #include +#elif HAVE_NCURSES_CURSES_H +#include #else +// Solaris curses defines lots of unneeded macros which conflict with C++ +#define NOMACROS #include +#undef NOMACROS #endif #if HAVE_TERM_H diff --git a/proc.cpp b/proc.cpp index 1c8b8e6d3..a1a393f3d 100644 --- a/proc.cpp +++ b/proc.cpp @@ -33,8 +33,13 @@ Some of the code in this file is based on code from the Glibc manual. #if HAVE_NCURSES_H #include +#elif HAVE_NCURSES_CURSES_H +#include #else +// Solaris curses defines lots of unneeded macros which conflict with C++ +#define NOMACROS #include +#undef NOMACROS #endif #if HAVE_TERM_H diff --git a/reader.cpp b/reader.cpp index 9e1afd224..07ee5154e 100644 --- a/reader.cpp +++ b/reader.cpp @@ -45,8 +45,13 @@ commence. #if HAVE_NCURSES_H #include +#elif HAVE_NCURSES_CURSES_H +#include #else +// Solaris curses defines lots of unneeded macros which conflict with C++ +#define NOMACROS #include +#undef NOMACROS #endif #if HAVE_TERM_H diff --git a/screen.cpp b/screen.cpp index 36a31f4b0..d4bf02ae4 100644 --- a/screen.cpp +++ b/screen.cpp @@ -20,8 +20,13 @@ efficient way for transforming that to the desired screen content. #if HAVE_NCURSES_H #include +#elif HAVE_NCURSES_CURSES_H +#include #else +// Solaris curses defines lots of unneeded macros which conflict with C++ +#define NOMACROS #include +#undef NOMACROS #endif #if HAVE_TERM_H