Skip to content

Commit

Permalink
build: Check curses "bool" type compatibility
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Explorer09 committed Oct 28, 2024
1 parent 7dfd4dd commit a1f2175
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdbool.h>
#include "ProvideCurses.h"
]], [[
keypad(stdscr, 0);
keypad(stdscr, false);
refresh();
Expand Down

0 comments on commit a1f2175

Please sign in to comment.