summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2011-02-06 15:25:58 +0100
committerBruno Haible <bruno@clisp.org>2011-02-07 23:36:08 +0100
commitcdddb1e1f27b899a9580d3ad289539c3c124d045 (patch)
treea96916c036086cdc4d66a3240105b3edf87e1de5 /m4
parent8e5e25f79c3ff689fc3a3aab0fe439064ef76d02 (diff)
downloadgnulib-cdddb1e1f27b899a9580d3ad289539c3c124d045.tar.gz
New module 'wcstok'.
* modules/wcstok: New file. * lib/wchar.in.h (wcstok): New declaration. * lib/wcstok.c: New file. * lib/wcstok-impl.h: New file, from libutf8 with modifications. * m4/wcstok.m4: New file. * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcstok is declared. (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCSTOK, HAVE_WCSTOK. * modules/wchar (Makefile.am): Substitute GNULIB_WCSTOK, HAVE_WCSTOK. * tests/test-wchar-c++.cc: Test the declaration of wcstok. * doc/posix-functions/wcstok.texi: Mention the new module.
Diffstat (limited to 'm4')
-rw-r--r--m4/wchar_h.m44
-rw-r--r--m4/wcstok.m415
2 files changed, 18 insertions, 1 deletions
diff --git a/m4/wchar_h.m4 b/m4/wchar_h.m4
index 9e5fbcdd5e..f320dd7931 100644
--- a/m4/wchar_h.m4
+++ b/m4/wchar_h.m4
@@ -53,7 +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 wcsspn wcspbrk wcsstr
+ wcscspn wcsspn wcspbrk wcsstr wcstok
])
])
@@ -174,6 +174,7 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS],
GNULIB_WCSSPN=0; AC_SUBST([GNULIB_WCSSPN])
GNULIB_WCSPBRK=0; AC_SUBST([GNULIB_WCSPBRK])
GNULIB_WCSSTR=0; AC_SUBST([GNULIB_WCSSTR])
+ GNULIB_WCSTOK=0; AC_SUBST([GNULIB_WCSTOK])
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC])
HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT])
@@ -210,6 +211,7 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS],
HAVE_WCSSPN=1; AC_SUBST([HAVE_WCSSPN])
HAVE_WCSPBRK=1; AC_SUBST([HAVE_WCSPBRK])
HAVE_WCSSTR=1; AC_SUBST([HAVE_WCSSTR])
+ HAVE_WCSTOK=1; AC_SUBST([HAVE_WCSTOK])
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/wcstok.m4 b/m4/wcstok.m4
new file mode 100644
index 0000000000..4c91c4f6fa
--- /dev/null
+++ b/m4/wcstok.m4
@@ -0,0 +1,15 @@
+# wcstok.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_WCSTOK],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wcstok])
+ if test $ac_cv_func_wcstok = no; then
+ HAVE_WCSTOK=0
+ AC_LIBOBJ([wcstok])
+ fi
+])