diff -ruN a/configure b/configure --- a/configure 2026-06-06 04:54:35.000000000 -0500 +++ b/configure 2026-06-08 21:43:31.051165555 -0500 @@ -12623,6 +12623,7 @@ ### use option --enable-widec to turn on use of wide-character support NCURSES_CH_T=chtype NCURSES_LIBUTF8=0 +NCURSES_WIDECHAR=0 NEED_WCHAR_H=0 NCURSES_MBSTATE_T=0 @@ -12862,6 +12863,7 @@ #define NCURSES_WIDECHAR 1 EOF + NCURSES_WIDECHAR=1 case "$CPPFLAGS" in (*_XOPEN_SOURCE=*) ;; @@ -30784,6 +30786,7 @@ s,@NCURSES_WCWIDTH_GRAPHICS@,$NCURSES_WCWIDTH_GRAPHICS,;t t s,@NCURSES_CH_T@,$NCURSES_CH_T,;t t s,@NCURSES_LIBUTF8@,$NCURSES_LIBUTF8,;t t +s,@NCURSES_WIDECHAR@,$NCURSES_WIDECHAR,;t t s,@NEED_WCHAR_H@,$NEED_WCHAR_H,;t t s,@NCURSES_MBSTATE_T@,$NCURSES_MBSTATE_T,;t t s,@NCURSES_WCHAR_T@,$NCURSES_WCHAR_T,;t t diff -ruN a/configure.in b/configure.in --- a/configure.in 2026-05-30 14:20:26.000000000 -0500 +++ b/configure.in 2026-06-08 21:43:31.043165313 -0500 @@ -880,6 +880,7 @@ ### use option --enable-widec to turn on use of wide-character support NCURSES_CH_T=chtype NCURSES_LIBUTF8=0 +NCURSES_WIDECHAR=0 NEED_WCHAR_H=0 NCURSES_MBSTATE_T=0 @@ -912,6 +913,7 @@ fi AC_DEFINE(USE_WIDEC_SUPPORT,1,[Define to 1 to compile with wide character and UTF-8 support]) AC_DEFINE(NCURSES_WIDECHAR,1,[Define to 1 to compile with wide character and UTF-8 support]) + NCURSES_WIDECHAR=1 case "$CPPFLAGS" in (*_XOPEN_SOURCE=*) ;; @@ -945,6 +947,7 @@ fi AC_SUBST(NCURSES_CH_T) AC_SUBST(NCURSES_LIBUTF8) +AC_SUBST(NCURSES_WIDECHAR) AC_SUBST(NEED_WCHAR_H) AC_SUBST(NCURSES_MBSTATE_T) diff -ruN a/include/MKterm.h.awk.in b/include/MKterm.h.awk.in --- a/include/MKterm.h.awk.in 2025-12-26 17:33:14.000000000 -0600 +++ b/include/MKterm.h.awk.in 2026-06-08 21:54:26.409799414 -0500 @@ -126,14 +126,14 @@ print "#undef SET_TTY" print "#undef GET_TTY" print "" - print "#if @HAVE_TERMIOS_H@ && @HAVE_TCGETATTR@ /* #if HAVE_TERMIOS_H && HAVE_TCGETATTR */" + print "#if HAVE_TERMIOS_H && HAVE_TCGETATTR /* #if HAVE_TERMIOS_H && HAVE_TCGETATTR */" print "" print "#undef TERMIOS" print "#define TERMIOS 1" print "#include " print "#define TTY struct termios" print "" - print "#elif @HAVE_TERMIO_H@ /* HAVE_TERMIO_H */" + print "#elif HAVE_TERMIO_H /* HAVE_TERMIO_H */" print "" print "#undef TERMIOS" print "#define TERMIOS 1" @@ -145,7 +145,7 @@ print "#include " print "#define TTY ConsoleMode" print "" - print "#elif @HAVE_SGTTY_H@ /* HAVE_SGTTY_H */" + print "#elif HAVE_SGTTY_H /* HAVE_SGTTY_H */" print "" print "#undef TERMIOS" print "#include " @@ -165,7 +165,7 @@ print "#elif defined(_WIN32) || defined(_WIN64)" print "#define GET_TTY(fd, buf) _nc_console_getmode(_nc_console_fd2handle(fd),buf)" print "#define SET_TTY(fd, buf) _nc_console_setmode(_nc_console_fd2handle(fd),buf)" - print "#elif @HAVE_SGTTY_H@ /* HAVE_SGTTY_H */" + print "#elif HAVE_SGTTY_H /* HAVE_SGTTY_H */" print "#define GET_TTY(fd, buf) gtty(fd, buf)" print "#define SET_TTY(fd, buf) stty(fd, buf)" print "#endif" diff -ruN a/include/curses.h.in b/include/curses.h.in --- a/include/curses.h.in 2026-05-30 14:13:55.000000000 -0500 +++ b/include/curses.h.in 2026-06-08 21:43:31.051165555 -0500 @@ -254,10 +254,14 @@ * conflicting) when _XOPEN_SOURCE is 500 or greater. If NCURSES_WIDECHAR is * not already defined, e.g., if the platform relies upon nonstandard feature * test macros, define it at this point if the standard feature test macros - * indicate that it should be defined. + * indicate that it should be defined. Prefer the configure-time result when + * generating the ncurses headers, so building a wide-character library does + * not depend on the host's feature-test macro policy. */ #ifndef NCURSES_WIDECHAR -#if defined(_XOPEN_SOURCE_EXTENDED) || (defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE - 0 >= 500)) +#if @NCURSES_WIDECHAR@ /* NCURSES_WIDECHAR */ +#define NCURSES_WIDECHAR 1 +#elif defined(_XOPEN_SOURCE_EXTENDED) || (defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE - 0 >= 500)) #define NCURSES_WIDECHAR 1 #else #define NCURSES_WIDECHAR 0 diff -ruN a/include/ncurses_cfg.hin b/include/ncurses_cfg.hin --- a/include/ncurses_cfg.hin 2024-06-08 09:04:14.000000000 -0500 +++ b/include/ncurses_cfg.hin 2026-06-08 21:59:39.717239025 -0500 @@ -50,6 +50,55 @@ #define NC_CONFIG_H @DEFS@ +/* + * Vertex builds ncurses as a Linux wide-character library. Keep the private + * generated headers coherent when cross/sysroot feature probes are cached or + * skipped by the package manager. + */ +#ifndef SIG_ATOMIC_T +#define SIG_ATOMIC_T volatile sig_atomic_t +#endif + +#ifndef HAVE_TERMIOS_H +#define HAVE_TERMIOS_H 1 +#endif + +#ifndef HAVE_TCGETATTR +#define HAVE_TCGETATTR 1 +#endif + +#ifndef HAVE_LIMITS_H +#define HAVE_LIMITS_H 1 +#endif + +#ifndef HAVE_UNISTD_H +#define HAVE_UNISTD_H 1 +#endif + +#ifndef HAVE_MBLEN +#define HAVE_MBLEN 1 +#endif + +#ifndef HAVE_MBTOWC +#define HAVE_MBTOWC 1 +#endif + +#ifndef HAVE_MBRLEN +#define HAVE_MBRLEN 1 +#endif + +#ifndef HAVE_MBRTOWC +#define HAVE_MBRTOWC 1 +#endif + +#ifndef USE_WIDEC_SUPPORT +#define USE_WIDEC_SUPPORT 1 +#endif + +#ifndef NCURSES_WIDECHAR +#define NCURSES_WIDECHAR 1 +#endif + #include /* The C compiler may not treat these properly but C++ has to */ diff -ruN a/ncurses/base/lib_pad.c b/ncurses/base/lib_pad.c --- a/ncurses/base/lib_pad.c 2024-12-07 11:44:59.000000000 -0600 +++ b/ncurses/base/lib_pad.c 2026-06-08 22:02:50.246305708 -0500 @@ -257,8 +257,8 @@ register struct ldat *pline = &CurScreen(sp)->_line[nind]; for (j = 0; j <= my_len; j++) { int k = NewScreen(sp)->_maxx - j; - if (pline->text[j] != nline->text[j] - || pline->text[k] != nline->text[k]) { + if (!CharEq(pline->text[j], nline->text[j]) + || !CharEq(pline->text[k], nline->text[k])) { nind = _NEWINDEX; break; }