1 dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
3 dnl Copyright (C) 2006 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl Written by Paul Eggert.
10 AC_DEFUN([gl_WCTYPE_H],
12 AC_CHECK_FUNCS_ONCE([iswcntrl])
13 AC_CHECK_HEADERS_ONCE([wctype.h])
14 AC_REQUIRE([AC_C_INLINE])
16 if test $ac_cv_header_wctype_h = yes; then
17 gl_ABSOLUTE_HEADER([wctype.h])
18 ABSOLUTE_WCTYPE_H=\"$gl_cv_absolute_wctype_h\"
21 ABSOLUTE_WCTYPE_H=\"no/such/file/wctype.h\"
24 AC_SUBST([ABSOLUTE_WCTYPE_H])
25 AC_SUBST([HAVE_WCTYPE_H])
28 HAVE_WCTYPE_CTMP_BUG=0
29 if test $ac_cv_header_wctype_h = yes; then
30 AC_CACHE_CHECK([whether wctype macros need _ctmp_ declared],
31 [gl_cv_wctype_ctmp_bug],
32 [gl_cv_wctype_ctmp_bug=no
37 [[return iswprint (0);]])],
38 [gl_cv_wctype_ctmp_bug='no, but bare wctype.h does not work'],
42 static wint_t _ctmp_;]],
43 [[return iswprint (0);]])],
44 [gl_cv_wctype_ctmp_bug=yes])])])
45 case $gl_cv_wctype_ctmp_bug,$ac_cv_func_iswcntrl in #(
47 HAVE_WCTYPE_CTMP_BUG=1;; #(
53 AC_SUBST([HAVE_WCTYPE_CTMP_BUG])