summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2011-02-06 14:10:45 +0100
committerBruno Haible <bruno@clisp.org>2011-02-07 23:36:07 +0100
commit1692395a63b2795a9d5c8e048e776f2e342fe2bb (patch)
treec7719084bf7bcc03914ac125a1ce3834700cb06b /m4
parentf966b70bca56f1925c529598012eabb7d9fec5bf (diff)
downloadgnulib-1692395a63b2795a9d5c8e048e776f2e342fe2bb.tar.gz
New module 'wcscspn'.
* modules/wcscspn: New file. * lib/wchar.in.h (wcscspn): New declaration. * lib/wcscspn.c: New file. * lib/wcscspn-impl.h: New file, from libutf8 with modifications. * m4/wcscspn.m4: New file. * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcscspn is declared. (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCSCSPN, HAVE_WCSCSPN. * modules/wchar (Makefile.am): Substitute GNULIB_WCSCSPN, HAVE_WCSCSPN. * tests/test-wchar-c++.cc: Test the declaration of wcscspn. * doc/posix-functions/wcscspn.texi: Mention the new module.
Diffstat (limited to 'm4')
-rw-r--r--m4/wchar_h.m43
-rw-r--r--m4/wcscspn.m415
2 files changed, 18 insertions, 0 deletions
diff --git a/m4/wchar_h.m4 b/m4/wchar_h.m4
index 2dbbb163b0..c86c9e920a 100644
--- a/m4/wchar_h.m4
+++ b/m4/wchar_h.m4
@@ -53,6 +53,7 @@ AC_DEFUN([gl_WCHAR_H],
wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset
wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp
wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr
+ wcscspn
])
])
@@ -169,6 +170,7 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS],
GNULIB_WCSDUP=0; AC_SUBST([GNULIB_WCSDUP])
GNULIB_WCSCHR=0; AC_SUBST([GNULIB_WCSCHR])
GNULIB_WCSRCHR=0; AC_SUBST([GNULIB_WCSRCHR])
+ GNULIB_WCSCSPN=0; AC_SUBST([GNULIB_WCSCSPN])
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC])
HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT])
@@ -201,6 +203,7 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS],
HAVE_WCSDUP=1; AC_SUBST([HAVE_WCSDUP])
HAVE_WCSCHR=1; AC_SUBST([HAVE_WCSCHR])
HAVE_WCSRCHR=1; AC_SUBST([HAVE_WCSRCHR])
+ HAVE_WCSCSPN=1; AC_SUBST([HAVE_WCSCSPN])
HAVE_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB])
HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH])
REPLACE_MBSTATE_T=0; AC_SUBST([REPLACE_MBSTATE_T])
diff --git a/m4/wcscspn.m4 b/m4/wcscspn.m4
new file mode 100644
index 0000000000..f6761faa33
--- /dev/null
+++ b/m4/wcscspn.m4
@@ -0,0 +1,15 @@
+# wcscspn.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_WCSCSPN],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wcscspn])
+ if test $ac_cv_func_wcscspn = no; then
+ HAVE_WCSCSPN=0
+ AC_LIBOBJ([wcscspn])
+ fi
+])