dnl CF_MIN_GETCCHAR version: 3 updated: 2010/10/23 15:54:49
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([
#include <stdlib.h>
#include <stdarg.h>
#include <${cf_cv_ncurses_header:-curses.h}>

int main()
{
	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
