From b6719eb383828e1cf04f4039edb0e4d8ba8a3587 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Fri, 8 Oct 2021 17:35:04 +0200 Subject: PDCurses support: automatically detect PDC_WIDE * PDC_WIDE must be defined before including curses.h if the library is also built against PDC_WIDE. * Fixes building against PDCursesMod during Nightly Builds, ie. fixes the current Win32 curses builds. * The same problem exists for PDC_RGB. It cannot currently be autodetected, so you must currently manually include PDCURSES_CFLAGS="-DPDC_RGB" if you built your PDCurses with PDC_RGB. The same will be true for PDC_NCMOUSE once we support mouses. You best leave these settings in their defaults (disabled) if you have control over the PDCurses build. --- configure.ac | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index b2e6b2e..4a24316 100644 --- a/configure.ac +++ b/configure.ac @@ -247,7 +247,7 @@ case $INTERFACE in AC_MSG_RESULT([$XCURSES_LIBS]) LIBS="$LIBS $XCURSES_LIBS" - # This is also used by the curses.h itself: + # It is crucial to define XCURSES before including curses.h. AC_DEFINE(XCURSES, 1, [Enable PDCurses/XCurses extensions]) AC_DEFINE(PDCURSES_GUI, 1, [PDCurses with GUI window]) @@ -280,6 +280,11 @@ case $INTERFACE in AC_DEFINE(PDCURSES_MOD, 1, [PDCursesMod extensions]) ]) + # It is crucial to define PDC_WIDE before including curses.h. + AC_CHECK_FUNC([add_wch], [ + AC_DEFINE(PDC_WIDE, 1, [Built with wide-character support]) + ]) + # This is detectable at runtime on PDCursesMod using PDC_get_version(). # "Classic" PDCurses does not allow runtime or compile-time checks for # discerning eg. WinCon from SDL. -- cgit v1.2.3