mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-10 15:14:44 +00:00
cmake: adjust logic for TPARM_VARARGS
- Define it before the headers so they can pick the variadic tparm prototype. - We need a TPARM_VARARGS define, add it to config_cmake.h. - Move & adjust comment - put it near the code, and mentiont that NetBSD curses doesn't need the kludge. Now variadic tparm is used on NetBSD instead of the Solaris kludge.
This commit is contained in:
parent
ee943a0821
commit
934f708ef6
2 changed files with 9 additions and 16 deletions
|
@ -131,7 +131,6 @@ CMAKE_POP_CHECK_STATE()
|
||||||
|
|
||||||
CHECK_TYPE_SIZE("wchar_t[8]" WCHAR_T_BITS LANGUAGE CXX)
|
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)
|
SET(TPARM_INCLUDES)
|
||||||
IF(HAVE_NCURSES_H)
|
IF(HAVE_NCURSES_H)
|
||||||
SET(TPARM_INCLUDES "${TPARM_INCLUDES}#include <ncurses.h>\n")
|
SET(TPARM_INCLUDES "${TPARM_INCLUDES}#include <ncurses.h>\n")
|
||||||
|
@ -147,9 +146,11 @@ ELSEIF(HAVE_NCURSES_TERM_H)
|
||||||
SET(TPARM_INCLUDES "${TPARM_INCLUDES}#include <ncurses/term.h>\n")
|
SET(TPARM_INCLUDES "${TPARM_INCLUDES}#include <ncurses/term.h>\n")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
# Solaris and X/Open-conforming systems have a fixed-args tparm
|
||||||
CMAKE_PUSH_CHECK_STATE()
|
CMAKE_PUSH_CHECK_STATE()
|
||||||
LIST(APPEND CMAKE_REQUIRED_LIBRARIES ${CURSES_LIBRARY})
|
LIST(APPEND CMAKE_REQUIRED_LIBRARIES ${CURSES_LIBRARY})
|
||||||
CHECK_CXX_SOURCE_COMPILES("
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
|
#define TPARM_VARARGS
|
||||||
${TPARM_INCLUDES}
|
${TPARM_INCLUDES}
|
||||||
|
|
||||||
int main () {
|
int main () {
|
||||||
|
@ -158,22 +159,11 @@ int main () {
|
||||||
"
|
"
|
||||||
TPARM_TAKES_VARARGS
|
TPARM_TAKES_VARARGS
|
||||||
)
|
)
|
||||||
IF(NOT TPARM_TAKES_VARARGS)
|
|
||||||
CHECK_CXX_SOURCE_COMPILES("
|
|
||||||
${TPARM_INCLUDES}
|
|
||||||
#define TPARM_VARARGS
|
|
||||||
|
|
||||||
int main () {
|
IF(TPARM_TAKES_VARARGS)
|
||||||
tparm( \"\" );
|
SET(TPARM_VARARGS 1)
|
||||||
}
|
ELSE()
|
||||||
"
|
SET(TPARM_SOLARIS_KLUDGE 1)
|
||||||
TPARM_TAKES_VARARGS_WITH_VARARGS
|
|
||||||
)
|
|
||||||
IF(NOT TPARM_TAKES_VARARGS)
|
|
||||||
SET(TPARM_SOLARIS_KLUDGE 1)
|
|
||||||
ELSE()
|
|
||||||
SET(TPARM_VARARGS 1)
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
CMAKE_POP_CHECK_STATE()
|
CMAKE_POP_CHECK_STATE()
|
||||||
|
|
||||||
|
|
|
@ -145,6 +145,9 @@
|
||||||
/* Define to the full name of this package. */
|
/* Define to the full name of this package. */
|
||||||
#define PACKAGE_NAME "fish"
|
#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. */
|
/* Define to 1 if tparm accepts a fixed amount of parameters. */
|
||||||
#cmakedefine TPARM_SOLARIS_KLUDGE 1
|
#cmakedefine TPARM_SOLARIS_KLUDGE 1
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue