Hash :
f4ad51ee
Author :
Date :
2023-07-26T14:50:00
wctype: Work around wctype bug on mingw. * lib/wctype.in.h (rpl_wctype_t, wctype_t, GNULIB_defined_wctype_t): Define if REPLACE_WCTYPE is 1. (wctype): Consider REPLACE_WCTYPE. (iswctype): Override also if REPLACE_WCTYPE is 1. * lib/iswctype.c: If GNULIB_defined_wctype_t is defined, use the function-pointer based implementation. * m4/wctype_h.m4 (gl_WCTYPE_H_DEFAULTS): Initialize REPLACE_WCTYPE. * m4/wctype.m4 (gl_FUNC_WCTYPE): Define through AC_DEFUN_ONCE. Test whether wctype supports the "blank" character class. Set REPLACE_WCTYPE if not. * m4/iswctype.m4 (gl_FUNC_ISWCTYPE): Require gl_FUNC_WCTYPE. * modules/wctype (Status, Notice): Remove. (Depends-on): Add iswctype. Consider REPLACE_WCTYPE. (configure.ac): Consider REPLACE_WCTYPE. * modules/iswctype (Status, Notice): Remove. (Files): Add m4/wctype.m4. (configure.ac): Override also if REPLACE_WCTYPE is 1. * modules/wctype-h (Makefile.am): Substitute REPLACE_WCTYPE. * doc/posix-functions/wctype.texi: Mention the mingw bug.
/* Test whether a wide character has a given property.
Copyright (C) 2011-2023 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2011.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#include <config.h>
/* Specification. */
#include <wctype.h>
#if GNULIB_defined_wint_t && !GNULIB_defined_wctype_t
int
iswctype (wint_t wc, wctype_t desc)
# undef iswctype
{
return ((wchar_t) wc == wc ? iswctype ((wchar_t) wc, desc) : 0);
}
#else
# include "iswctype-impl.h"
#endif