From 2c4e92e2be28b96b377265fd28288fd3c11dbf52 Mon Sep 17 00:00:00 2001 From: Explorer09 Date: Mon, 28 Oct 2024 19:25:11 +0800 Subject: [PATCH] build: Check curses "bool" type compatibility curses.h may define its own "bool" type, because the X/Open Curses standard defines "bool" that predates C99 "bool". If curses.h "bool" is not compatible with ISO C, fail at configure time. (The C23 standard now makes "bool" a keyword so that a "typedef /*whatever*/ bool;" is no longer portable. This is a bug that curses implementations should fix.) Solaris 11 is known to ship with a broken curses.h header (the default curses, not ncurses). Signed-off-by: Kang-Che Sung --- configure.ac | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 6a7926dee..cb84b9252 100644 --- a/configure.ac +++ b/configure.ac @@ -696,9 +696,12 @@ CFLAGS="-I$srcdir $CFLAGS" # "stdscr" is a macro in ncursest (reentrant version of ncurses). AC_MSG_CHECKING([whether the curses header works]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +/* Checks if the "bool" definition in curses is ISO C compatible */ +#include + #include "ProvideCurses.h" ]], [[ -keypad(stdscr, 0); +keypad(stdscr, false); refresh();