dnl CF_MIN_GETCCHAR version: 4 updated: 2023/01/05 18:53:43
dnl ---------------
dnl CF_MIN_GETCCHAR
dnl Check whether getcchar's return value counts the trailing null in a wchar_t
dnl string, or not.  X/Open says it does, but Tru64 and Solaris do not do this.
AC_DEFUN([CF_MIN_GETCCHAR],[
AC_CACHE_CHECK(if getcchar counts trailing null,cf_cv_min_getcchar,[
AC_TRY_RUN([
$ac_includes_default
#include <${cf_cv_ncurses_header:-curses.h}>

int main(void)
{
	wchar_t data[2];
	cchar_t temp[2];
	int count;
	data[0] = L'\0';
    setcchar(temp, data, 0, 0, (void *)0);
	count = getcchar(temp, (wchar_t *)0, (attr_t *)0, (short *)0, (void *)0);
	${cf_cv_main_return:-return}(count != 0);
}],
	[cf_cv_min_getcchar=no],
	[cf_cv_min_getcchar=yes],
	[cf_cv_min_getcchar=yes])
])
if test "$cf_cv_min_getcchar" = yes ; then
	AC_DEFINE(MIN_GETCCHAR,1)
fi
])dnl
