From 3b66b2040ec117f9f6d61b701fd339f9990b3719 Mon Sep 17 00:00:00 2001 From: Explorer09 Date: Tue, 29 Oct 2024 07:59:14 +0800 Subject: [PATCH] build: check for wadd_wchnstr() rather than mvadd_wchnstr() According to ncurses man page, mvadd_wchnstr() may be implemented as a macro. Signed-off-by: Kang-Che Sung --- configure.ac | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index f53917721..857d865bf 100644 --- a/configure.ac +++ b/configure.ac @@ -482,13 +482,17 @@ doupdate(); htop_curses_status=1]) fi + # htop calls mvadd_wchnstr(), which might be implemented as a macro. + # It is more reliable to test linking with wadd_wchnstr(). if test "x$htop_curses_status$enable_unicode" = x0yes; then - AC_MSG_CHECKING([for mvadd_wchnstr in $htop_msg_linker_flags]) + AC_MSG_CHECKING([for wadd_wchnstr in $htop_msg_linker_flags]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[ -/* int mvadd_wchnstr(int y, int x, const cchar_t* wchstr, int n); */ -int mvadd_wchnstr(int y, int x, const void* wchstr, int n); +/* int wadd_wchnstr(WINDOW* win, const cchar_t* wchstr, int n); */ +int wadd_wchnstr(void* win, const void* wchstr, int n); ]], [[ -mvadd_wchnstr(0, 0, (void*)0, 0); +static char dummy1; +static char dummy2; +wadd_wchnstr((void*)&dummy1, (void*)&dummy2, 0); ]])], [AC_MSG_RESULT(yes) htop_curses_capability=wide],