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 <explorer09@gmail.com>
  • Loading branch information
Explorer09 committed Oct 28, 2024
1 parent 4ddb9cc commit 2c4e92e
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 2c4e92e

Please sign in to comment.