* lib/wctype.in.h (iswblank): Don't declare if GNULIB_ISWBLANK is 0.
* modules/iswblank: New file.
* modules/wctype-h (Files): Remove lib/iswblank.c.
(Makefile.am): Substitute GNULIB_ISWBLANK.
* m4/iswblank.m4: New file, partially extracted from m4/wctype_h.m4.
* m4/wctype_h.m4 (gl_WCTYPE_MODULE_INDICATOR): New macro.
(gl_WCTYPE_H_DEFAULTS): New macro.
(gl_WCTYPE_H): Require it. Remove iswblank related code.
* modules/iswblank-tests: New file.
* tests/test-iswblank.c: New file, extraced from tests/test-wctype-h.c.
* tests/test-wctype-h.c (main): Remove iswblank tests.
* tests/test-wctype-h-c++.cc: Guard the signature test of iswblank.
* doc/posix-functions/iswblank.texi: Mention module 'iswblank' instead
of 'wctype-h'.
* NEWS: Mention the change.
* modules/mbchar (Depends-on): Add iswblank.
+2011-02-06 Bruno Haible <bruno@clisp.org>
+
+ New module 'iswblank'.
+ * lib/wctype.in.h (iswblank): Don't declare if GNULIB_ISWBLANK is 0.
+ * modules/iswblank: New file.
+ * modules/wctype-h (Files): Remove lib/iswblank.c.
+ (Makefile.am): Substitute GNULIB_ISWBLANK.
+ * m4/iswblank.m4: New file, partially extracted from m4/wctype_h.m4.
+ * m4/wctype_h.m4 (gl_WCTYPE_MODULE_INDICATOR): New macro.
+ (gl_WCTYPE_H_DEFAULTS): New macro.
+ (gl_WCTYPE_H): Require it. Remove iswblank related code.
+ * modules/iswblank-tests: New file.
+ * tests/test-iswblank.c: New file, extraced from tests/test-wctype-h.c.
+ * tests/test-wctype-h.c (main): Remove iswblank tests.
+ * tests/test-wctype-h-c++.cc: Guard the signature test of iswblank.
+ * doc/posix-functions/iswblank.texi: Mention module 'iswblank' instead
+ of 'wctype-h'.
+ * NEWS: Mention the change.
+ * modules/mbchar (Depends-on): Add iswblank.
+
2011-02-08 Bruno Haible <bruno@clisp.org>
di-set tests: Refactor.
Date Modules Changes
+2011-02-08 wctype-h This module no longer provides the iswblank()
+ function. If you need this function, you now need
+ to request the 'iswblank' module.
+
2011-02-07 wctype This module is renamed to wctype-h.
2011-01-18 multiarch This no longer #defines AA_APPLE_UNIVERSAL_BUILD;
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/iswblank.html}
-Gnulib module: wctype-h
+Gnulib module: iswblank
Portability problems fixed by Gnulib:
@itemize
return (wc >= 'a' && wc <= 'z' ? wc - 'a' + 'A' : wc);
}
-# elif ! @HAVE_ISWBLANK@ || @REPLACE_ISWBLANK@
+# elif @GNULIB_ISWBLANK@ && (! @HAVE_ISWBLANK@ || @REPLACE_ISWBLANK@)
/* Only the iswblank function is missing. */
# if @REPLACE_ISWBLANK@
#if @REPLACE_ISWCNTRL@
_GL_CXXALIAS_RPL (iswalnum, int, (wint_t wc));
_GL_CXXALIAS_RPL (iswalpha, int, (wint_t wc));
-_GL_CXXALIAS_RPL (iswblank, int, (wint_t wc));
_GL_CXXALIAS_RPL (iswcntrl, int, (wint_t wc));
_GL_CXXALIAS_RPL (iswdigit, int, (wint_t wc));
_GL_CXXALIAS_RPL (iswgraph, int, (wint_t wc));
#else
_GL_CXXALIAS_SYS (iswalnum, int, (wint_t wc));
_GL_CXXALIAS_SYS (iswalpha, int, (wint_t wc));
-# if @REPLACE_ISWBLANK@
-_GL_CXXALIAS_RPL (iswblank, int, (wint_t wc));
-# else
-_GL_CXXALIAS_SYS (iswblank, int, (wint_t wc));
-# endif
_GL_CXXALIAS_SYS (iswcntrl, int, (wint_t wc));
_GL_CXXALIAS_SYS (iswdigit, int, (wint_t wc));
_GL_CXXALIAS_SYS (iswgraph, int, (wint_t wc));
#endif
_GL_CXXALIASWARN (iswalnum);
_GL_CXXALIASWARN (iswalpha);
-_GL_CXXALIASWARN (iswblank);
_GL_CXXALIASWARN (iswcntrl);
_GL_CXXALIASWARN (iswdigit);
_GL_CXXALIASWARN (iswgraph);
_GL_CXXALIASWARN (iswupper);
_GL_CXXALIASWARN (iswxdigit);
+#if @GNULIB_ISWBLANK@
+# if @REPLACE_ISWCNTRL@ || @REPLACE_ISWBLANK@
+_GL_CXXALIAS_RPL (iswblank, int, (wint_t wc));
+# else
+_GL_CXXALIAS_SYS (iswblank, int, (wint_t wc));
+# endif
+_GL_CXXALIASWARN (iswblank);
+#endif
+
#if @REPLACE_ISWCNTRL@ || defined __MINGW32__
_GL_CXXALIAS_RPL (towlower, wint_t, (wint_t wc));
_GL_CXXALIAS_RPL (towupper, wint_t, (wint_t wc));
--- /dev/null
+# iswblank.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_ISWBLANK],
+[
+ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
+ AC_REQUIRE([gl_WCTYPE_H])
+ AC_CHECK_FUNCS_ONCE([iswblank])
+ AC_CHECK_DECLS_ONCE([iswblank])
+ if test $ac_cv_func_iswblank = no; then
+ HAVE_ISWBLANK=0
+ if test $ac_cv_have_decl_iswblank = yes; then
+ REPLACE_ISWBLANK=1
+ fi
+ fi
+ if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+ dnl Redefine all of iswcntrl, ..., towupper in <wctype.h>.
+ :
+ else
+ if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then
+ dnl Redefine only iswblank.
+ AC_LIBOBJ([iswblank])
+ fi
+ fi
+
+])
-# wctype_h.m4 serial 12
+# wctype_h.m4 serial 13
dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
AC_DEFUN([gl_WCTYPE_H],
[
+ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_CANONICAL_HOST])
AC_CHECK_FUNCS_ONCE([iswcntrl])
HAVE_ISWCNTRL=0
fi
AC_SUBST([HAVE_ISWCNTRL])
- AC_CHECK_FUNCS_ONCE([iswblank])
- AC_CHECK_DECLS_ONCE([iswblank])
- if test $ac_cv_func_iswblank = yes; then
- HAVE_ISWBLANK=1
- REPLACE_ISWBLANK=0
- else
- HAVE_ISWBLANK=0
- if test $ac_cv_have_decl_iswblank = yes; then
- REPLACE_ISWBLANK=1
- else
- REPLACE_ISWBLANK=0
- fi
- fi
- AC_SUBST([HAVE_ISWBLANK])
- AC_SUBST([REPLACE_ISWBLANK])
AC_REQUIRE([AC_C_INLINE])
if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
dnl Redefine all of iswcntrl, ..., towupper in <wctype.h>.
:
- else
- if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then
- dnl Redefine only iswblank.
- AC_LIBOBJ([iswblank])
- fi
fi
])
+
+AC_DEFUN([gl_WCTYPE_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_WCTYPE_H_DEFAULTS],
+[
+ GNULIB_ISWBLANK=0; AC_SUBST([GNULIB_ISWBLANK])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_ISWBLANK=1; AC_SUBST([HAVE_ISWBLANK])
+ REPLACE_ISWBLANK=0; AC_SUBST([REPLACE_ISWBLANK])
+])
--- /dev/null
+Description:
+iswblank() function: test wide character for being blank.
+
+Files:
+lib/iswblank.c
+m4/iswblank.m4
+
+Depends-on:
+wctype-h
+
+configure.ac:
+gl_FUNC_ISWBLANK
+gl_WCTYPE_MODULE_INDICATOR([iswblank])
+
+Makefile.am:
+
+Include:
+<wctype.h>
+
+License:
+LGPLv2+
+
+Maintainer:
+Bruno Haible
--- /dev/null
+Files:
+tests/test-iswblank.c
+tests/macros.h
+
+Depends-on:
+wctype-h-c++-tests
+
+configure.ac:
+
+Makefile.am:
+TESTS += test-iswblank
+check_PROGRAMS += test-iswblank
stdbool
wchar
wctype-h
+iswblank
wcwidth
memcmp
Files:
lib/wctype.in.h
-lib/iswblank.c
m4/wctype_h.m4
m4/wint_t.m4
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \
+ -e 's/@''GNULIB_ISWBLANK''@/$(GNULIB_ISWBLANK)/g' \
-e 's/@''HAVE_ISWBLANK''@/$(HAVE_ISWBLANK)/g' \
-e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \
-e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
--- /dev/null
+/* Test of iswblank() function.
+ Copyright (C) 2007-2011 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <wctype.h>
+
+#include "macros.h"
+
+/* Check that WEOF is defined. */
+wint_t e = WEOF;
+
+int
+main (void)
+{
+ /* Check that the function exist as a function or as a macro. */
+ (void) iswblank (0);
+ /* Check that the isw* functions map WEOF to 0. */
+ ASSERT (!iswblank (e));
+
+ return 0;
+}
SIGNATURE_CHECK (GNULIB_NAMESPACE::iswalnum, int, (wint_t));
SIGNATURE_CHECK (GNULIB_NAMESPACE::iswalpha, int, (wint_t));
+#if GNULIB_TEST_ISWBLANK
SIGNATURE_CHECK (GNULIB_NAMESPACE::iswblank, int, (wint_t));
+#endif
SIGNATURE_CHECK (GNULIB_NAMESPACE::iswcntrl, int, (wint_t));
SIGNATURE_CHECK (GNULIB_NAMESPACE::iswdigit, int, (wint_t));
SIGNATURE_CHECK (GNULIB_NAMESPACE::iswgraph, int, (wint_t));
/* Check that the isw* functions exist as functions or as macros. */
(void) iswalnum (0);
(void) iswalpha (0);
- (void) iswblank (0);
(void) iswcntrl (0);
(void) iswdigit (0);
(void) iswgraph (0);
/* Check that the isw* functions map WEOF to 0. */
ASSERT (!iswalnum (e));
ASSERT (!iswalpha (e));
- ASSERT (!iswblank (e));
ASSERT (!iswcntrl (e));
ASSERT (!iswdigit (e));
ASSERT (!iswgraph (e));