Skip to content

Commit

Permalink
build: check for wadd_wchnstr() rather than mvadd_wchnstr()
Browse files Browse the repository at this point in the history
According to ncurses man page, mvadd_wchnstr() may be implemented as a
macro.

Signed-off-by: Kang-Che Sung <[email protected]>
  • Loading branch information
Explorer09 authored and BenBE committed Dec 14, 2024
1 parent b458299 commit 3b66b20
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down

0 comments on commit 3b66b20

Please sign in to comment.