3 dnl Copyright (C) 2011-2024 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 AC_DEFUN_ONCE([gl_FUNC_WCTYPE],
10 AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
11 AC_REQUIRE([gl_WCTYPE_H])
12 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13 HAVE_WCTYPE=$HAVE_WCTYPE_T
14 if test $HAVE_WCTYPE = 1; then
15 AC_CACHE_CHECK([whether wctype supports the "blank" and "punct" character classes],
16 [gl_cv_func_wctype_works],
24 /* This test fails on mingw. */
25 if (wctype ("blank") == (wctype_t)0)
27 /* This test fails on MSVC 14. */
28 if ((! iswctype ('\t', wctype ("blank"))) != (! iswblank ('\t')))
30 /* This test fails on Android 11. */
31 if ((! iswctype ('\`', wctype ("punct"))) != (! ispunct ('\`')))
36 [gl_cv_func_wctype_works=yes], [gl_cv_func_wctype_works=no],
38 # Guess no on native Windows.
39 mingw* | windows*) gl_cv_func_wctype_works="guessing no" ;;
40 # Guess no on Android.
41 android*) gl_cv_func_wctype_works="guessing no" ;;
42 # Guess yes otherwise.
43 *) gl_cv_func_wctype_works="guessing yes" ;;
47 case "$gl_cv_func_wctype_works" in
49 *) REPLACE_WCTYPE=1 ;;