+2023-07-26 Bruno Haible <bruno@clisp.org>
+
+ wctype: Work around wctype+iswctype bug on MSVC.
+ * m4/wctype.m4 (gl_FUNC_WCTYPE): In the test program, test also for the
+ MSVC bug. Update cross-compilation guess.
+ * doc/posix-functions/wctype.texi: Mention the MSVC bug.
+
2023-07-26 Bruno Haible <bruno@clisp.org>
wctype: Work around wctype bug on mingw.
This function does not support the @code{"blank"} character class
on some platforms:
mingw.
+@item
+The object returned by this function for the @code{"blank"} character class
+is inconsistent with the @code{iswblank} and @code{isblank} functions
+on some platforms:
+MSVC 14.
@end itemize
Portability problems not fixed by Gnulib:
-# wctype.m4 serial 3
+# wctype.m4 serial 4
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_LANG_SOURCE([[
#include <wchar.h>
#include <wctype.h>
- int main () { return wctype ("blank") == (wctype_t)0; }
+ int main ()
+ {
+ /* This test fails on mingw. */
+ if (wctype ("blank") == (wctype_t)0)
+ return 1;
+ /* This test fails on MSVC 14. */
+ if ((! iswctype ('\t', wctype ("blank"))) != (! iswblank ('\t')))
+ return 2;
+ return 0;
+ }
]])],
[gl_cv_func_wctype_works=yes], [gl_cv_func_wctype_works=no],
[case "$host_os" in
- # Guess no on mingw.
- mingw*) AC_EGREP_CPP([Problem], [
-#ifdef __MINGW32__
- Problem
-#endif
- ],
- [gl_cv_func_wctype_works="guessing no"],
- [gl_cv_func_wctype_works="guessing yes"])
- ;;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_wctype_works="guessing no" ;;
# Guess yes otherwise.
*) gl_cv_func_wctype_works="guessing yes" ;;
esac