summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2011-02-05 12:47:22 +0100
committerBruno Haible <bruno@clisp.org>2011-02-07 23:36:01 +0100
commitc5c66975f77962d53fee68bc2766cc59cabf95e1 (patch)
tree89182ac1cbce9921549dc7b29a1adb875b5e2f9b /m4
parent6f0680eb29a1737d704a1df26aafc00490cd34d8 (diff)
downloadgnulib-c5c66975f77962d53fee68bc2766cc59cabf95e1.tar.gz
New module 'wmemcmp'.
* modules/wmemcmp: New file. * lib/wchar.in.h (wmemcmp): New declaration. * lib/wmemcmp.c: New file. * lib/wmemcmp-impl.h: New file, from libutf8 with modifications. * m4/wmemcmp.m4: New file. * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wmemcmp is declared. (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WMEMCMP, HAVE_WMEMCMP. * modules/wchar (Makefile.am): Substitute GNULIB_WMEMCMP, HAVE_WMEMCMP. * tests/test-wchar-c++.cc: Test the declaration of wmemcmp. * doc/posix-functions/wmemcmp.texi: Mention the new module.
Diffstat (limited to 'm4')
-rw-r--r--m4/wchar_h.m44
-rw-r--r--m4/wmemcmp.m415
2 files changed, 18 insertions, 1 deletions
diff --git a/m4/wchar_h.m4 b/m4/wchar_h.m4
index 9724d1389b..a94f9c8389 100644
--- a/m4/wchar_h.m4
+++ b/m4/wchar_h.m4
@@ -50,7 +50,7 @@ AC_DEFUN([gl_WCHAR_H],
#include <wchar.h>
]],
[btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb
- wcsrtombs wcsnrtombs wcwidth wmemchr
+ wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp
])
])
@@ -146,6 +146,7 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS],
GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS])
GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH])
GNULIB_WMEMCHR=0; AC_SUBST([GNULIB_WMEMCHR])
+ GNULIB_WMEMCMP=0; AC_SUBST([GNULIB_WMEMCMP])
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC])
HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT])
@@ -157,6 +158,7 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS],
HAVE_WCSRTOMBS=1; AC_SUBST([HAVE_WCSRTOMBS])
HAVE_WCSNRTOMBS=1; AC_SUBST([HAVE_WCSNRTOMBS])
HAVE_WMEMCHR=1; AC_SUBST([HAVE_WMEMCHR])
+ HAVE_WMEMCMP=1; AC_SUBST([HAVE_WMEMCMP])
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/wmemcmp.m4 b/m4/wmemcmp.m4
new file mode 100644
index 0000000000..99e9a2af73
--- /dev/null
+++ b/m4/wmemcmp.m4
@@ -0,0 +1,15 @@
+# wmemcmp.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_WMEMCMP],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([wmemcmp])
+ if test $ac_cv_func_wmemcmp = no; then
+ HAVE_WMEMCMP=0
+ AC_LIBOBJ([wmemcmp])
+ fi
+])