diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index be696da71..25dc9eb61 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -131,7 +131,6 @@ CMAKE_POP_CHECK_STATE() CHECK_TYPE_SIZE("wchar_t[8]" WCHAR_T_BITS LANGUAGE CXX) -# Solaris, NetBSD and X/Open-conforming systems have a fixed-args tparm SET(TPARM_INCLUDES) IF(HAVE_NCURSES_H) SET(TPARM_INCLUDES "${TPARM_INCLUDES}#include \n") @@ -147,9 +146,11 @@ ELSEIF(HAVE_NCURSES_TERM_H) SET(TPARM_INCLUDES "${TPARM_INCLUDES}#include \n") ENDIF() +# Solaris and X/Open-conforming systems have a fixed-args tparm CMAKE_PUSH_CHECK_STATE() LIST(APPEND CMAKE_REQUIRED_LIBRARIES ${CURSES_LIBRARY}) CHECK_CXX_SOURCE_COMPILES(" +#define TPARM_VARARGS ${TPARM_INCLUDES} int main () { @@ -158,22 +159,11 @@ int main () { " TPARM_TAKES_VARARGS ) -IF(NOT TPARM_TAKES_VARARGS) - CHECK_CXX_SOURCE_COMPILES(" -${TPARM_INCLUDES} -#define TPARM_VARARGS -int main () { - tparm( \"\" ); -} -" - TPARM_TAKES_VARARGS_WITH_VARARGS - ) - IF(NOT TPARM_TAKES_VARARGS) - SET(TPARM_SOLARIS_KLUDGE 1) - ELSE() - SET(TPARM_VARARGS 1) - ENDIF() +IF(TPARM_TAKES_VARARGS) + SET(TPARM_VARARGS 1) +ELSE() + SET(TPARM_SOLARIS_KLUDGE 1) ENDIF() CMAKE_POP_CHECK_STATE() diff --git a/config_cmake.h.in b/config_cmake.h.in index 471094269..0330940fa 100644 --- a/config_cmake.h.in +++ b/config_cmake.h.in @@ -145,6 +145,9 @@ /* Define to the full name of this package. */ #define PACKAGE_NAME "fish" +/* Use a variadic tparm on NetBSD curses. */ +#cmakedefine TPARM_VARARGS 1 + /* Define to 1 if tparm accepts a fixed amount of parameters. */ #cmakedefine TPARM_SOLARIS_KLUDGE 1