diff options
author | Bruno Haible <bruno@clisp.org> | 2011-02-06 13:42:05 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2011-02-07 23:36:06 +0100 |
commit | 5768aa52f6dd4fe3266bfa42f6a58f26b89c6c89 (patch) | |
tree | 86dd54f47bb3388b3c250fb8f41f98982d8f3579 /m4 | |
parent | 1c65c44a130b11ba5f128ad1db2f23aa82984c1a (diff) | |
download | gnulib-5768aa52f6dd4fe3266bfa42f6a58f26b89c6c89.tar.gz |
New module 'wcsdup'.
* modules/wcsdup: New file.
* lib/wchar.in.h (wcsdup): New declaration.
* lib/wcsdup.c: New file.
* lib/wcsdup-impl.h: New file, from libutf8 with modifications.
* m4/wcsdup.m4: New file.
* m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcsdup is declared.
(gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCSDUP, HAVE_WCSDUP.
* modules/wchar (Makefile.am): Substitute GNULIB_WCSDUP, HAVE_WCSDUP.
* tests/test-wchar-c++.cc: Test the declaration of wcsdup.
* doc/posix-functions/wcsdup.texi: Mention the new module.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/wchar_h.m4 | 4 | ||||
-rw-r--r-- | m4/wcsdup.m4 | 15 |
2 files changed, 18 insertions, 1 deletions
diff --git a/m4/wchar_h.m4 b/m4/wchar_h.m4 index 7905ce0d91..ab6f553c52 100644 --- a/m4/wchar_h.m4 +++ b/m4/wchar_h.m4 @@ -52,7 +52,7 @@ AC_DEFUN([gl_WCHAR_H], [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp - wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm + wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup ]) ]) @@ -166,6 +166,7 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS], GNULIB_WCSNCASECMP=0; AC_SUBST([GNULIB_WCSNCASECMP]) GNULIB_WCSCOLL=0; AC_SUBST([GNULIB_WCSCOLL]) GNULIB_WCSXFRM=0; AC_SUBST([GNULIB_WCSXFRM]) + GNULIB_WCSDUP=0; AC_SUBST([GNULIB_WCSDUP]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC]) HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT]) @@ -195,6 +196,7 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS], HAVE_WCSNCASECMP=1; AC_SUBST([HAVE_WCSNCASECMP]) HAVE_WCSCOLL=1; AC_SUBST([HAVE_WCSCOLL]) HAVE_WCSXFRM=1; AC_SUBST([HAVE_WCSXFRM]) + HAVE_WCSDUP=1; AC_SUBST([HAVE_WCSDUP]) 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/wcsdup.m4 b/m4/wcsdup.m4 new file mode 100644 index 0000000000..f3a35df543 --- /dev/null +++ b/m4/wcsdup.m4 @@ -0,0 +1,15 @@ +# wcsdup.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_WCSDUP], +[ + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([wcsdup]) + if test $ac_cv_func_wcsdup = no; then + HAVE_WCSDUP=0 + AC_LIBOBJ([wcsdup]) + fi +]) |