summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2011-02-06 23:45:40 +0100
committerBruno Haible <bruno@clisp.org>2011-02-09 20:54:31 +0100
commit896cde703cb740a97353474e0156b46119b69640 (patch)
tree998deac35b00ced505137ce03f34fb054570a2bc /m4
parent0224757f8cde66d8224107dbb30a81c3d4a5f9e6 (diff)
downloadgnulib-896cde703cb740a97353474e0156b46119b69640.tar.gz
New module 'wctype'.
* modules/wctype: Change to represent the wctype() substitute. * lib/wctype.in.h (wctype): New declaration. * lib/wctype.c: New file. * lib/wctype-impl.h: New file. * m4/wctype.m4: New file. * m4/wctype_h.m4 (gl_WCTYPE_H): Test whether wctype is declared. (gl_WCTYPE_H_DEFAULTS): Initialize GNULIB_WCTYPE. * modules/wctype-h (Makefile.am): Substitute GNULIB_WCTYPE. * tests/test-wctype-h-c++.cc: Test the declaration of wctype. * doc/posix-functions/wctype.texi: Mention the new module and the HP-UX 11.00 problem.
Diffstat (limited to 'm4')
-rw-r--r--m4/wctype.m414
-rw-r--r--m4/wctype_h.m419
2 files changed, 33 insertions, 0 deletions
diff --git a/m4/wctype.m4 b/m4/wctype.m4
new file mode 100644
index 0000000000..93c50d3fa1
--- /dev/null
+++ b/m4/wctype.m4
@@ -0,0 +1,14 @@
+# wctype.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_WCTYPE],
+[
+ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
+ AC_REQUIRE([gl_WCTYPE_H])
+ if test $HAVE_WCTYPE_T = 0; then
+ AC_LIBOBJ([wctype])
+ fi
+])
diff --git a/m4/wctype_h.m4 b/m4/wctype_h.m4
index 307d5e1bea..23f91759cf 100644
--- a/m4/wctype_h.m4
+++ b/m4/wctype_h.m4
@@ -130,6 +130,24 @@ AC_DEFUN([gl_WCTYPE_H],
if test $gl_cv_type_wctrans_t = no; then
HAVE_WCTRANS_T=0
fi
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
+# include <wchar.h>
+#endif
+#include <wctype.h>
+ ]],
+ [wctype
+ ])
])
AC_DEFUN([gl_WCTYPE_MODULE_INDICATOR],
@@ -144,6 +162,7 @@ AC_DEFUN([gl_WCTYPE_MODULE_INDICATOR],
AC_DEFUN([gl_WCTYPE_H_DEFAULTS],
[
GNULIB_ISWBLANK=0; AC_SUBST([GNULIB_ISWBLANK])
+ GNULIB_WCTYPE=0; AC_SUBST([GNULIB_WCTYPE])
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_ISWBLANK=1; AC_SUBST([HAVE_ISWBLANK])
HAVE_WCTYPE_T=1; AC_SUBST([HAVE_WCTYPE_T])