2023-08-29 Bruno Haible <bruno@clisp.org>
+ wctype: Rely on module iswpunct.
+ * m4/wctype.m4 (gl_FUNC_WCTYPE): Also test whether the "punct" class
+ works.
+ * modules/wctype (Depends-on): Add iswpunct.
+ * tests/test-iswctype.c (main): Add more tests of the "punct" class.
+ * doc/posix-functions/wctype.texi: Mention the Android problem.
+
c32ispunct: Rely on module iswpunct.
* modules/c32ispunct (Depends-on): Add iswpunct.
* tests/test-c32ispunct.c (main): Add a few more tests in the "C"
-# wctype.m4 serial 5
+# wctype.m4 serial 6
dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
HAVE_WCTYPE=$HAVE_WCTYPE_T
if test $HAVE_WCTYPE = 1; then
- AC_CACHE_CHECK([whether wctype supports the "blank" character class],
+ AC_CACHE_CHECK([whether wctype supports the "blank" and "punct" character classes],
[gl_cv_func_wctype_works],
[AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
+ #include <ctype.h>
#include <wchar.h>
#include <wctype.h>
int main ()
/* This test fails on MSVC 14. */
if ((! iswctype ('\t', wctype ("blank"))) != (! iswblank ('\t')))
return 2;
+ /* This test fails on Android 11. */
+ if ((! iswctype ('\`', wctype ("punct"))) != (! ispunct ('\`')))
+ return 4;
return 0;
}
]])],
[case "$host_os" in
# Guess no on native Windows.
mingw* | windows*) gl_cv_func_wctype_works="guessing no" ;;
+ # Guess no on Android.
+ android*) gl_cv_func_wctype_works="guessing no" ;;
# Guess yes otherwise.
*) gl_cv_func_wctype_works="guessing yes" ;;
esac
desc = wctype ("punct");
ASSERT (desc != (wctype_t) 0);
+ ASSERT (iswctype (L'!', desc));
+ ASSERT (iswctype (L'"', desc));
+ ASSERT (iswctype (L'#', desc));
ASSERT (iswctype (L'$', desc));
+ ASSERT (iswctype (L'%', desc));
+ ASSERT (iswctype (L'&', desc));
+ ASSERT (iswctype (L'\'', desc));
+ ASSERT (iswctype (L'(', desc));
+ ASSERT (iswctype (L')', desc));
+ ASSERT (iswctype (L'*', desc));
+ ASSERT (iswctype (L'+', desc));
+ ASSERT (iswctype (L',', desc));
+ ASSERT (iswctype (L'-', desc));
ASSERT (iswctype (L'.', desc));
+ ASSERT (iswctype (L'/', desc));
+ ASSERT (iswctype (L':', desc));
+ ASSERT (iswctype (L';', desc));
ASSERT (iswctype (L'<', desc));
+ ASSERT (iswctype (L'=', desc));
ASSERT (iswctype (L'>', desc));
+ ASSERT (iswctype (L'?', desc));
+ ASSERT (iswctype (L'@', desc));
+ ASSERT (iswctype (L'[', desc));
+ ASSERT (iswctype (L'\\', desc));
+ ASSERT (iswctype (L']', desc));
+ ASSERT (iswctype (L'^', desc));
+ ASSERT (iswctype (L'_', desc));
+ ASSERT (iswctype (L'`', desc));
+ ASSERT (iswctype (L'{', desc));
+ ASSERT (iswctype (L'|', desc));
+ ASSERT (iswctype (L'}', desc));
+ ASSERT (iswctype (L'~', desc));
ASSERT (! iswctype (L' ', desc));
ASSERT (! iswctype (L'a', desc));
ASSERT (! iswctype (L'1', desc));