From f966b70bca56f1925c529598012eabb7d9fec5bf Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 6 Feb 2011 14:02:26 +0100 Subject: New module 'wcsrchr'. * modules/wcsrchr: New file. * lib/wchar.in.h (wcsrchr): New declaration. * lib/wcsrchr.c: New file. * lib/wcsrchr-impl.h: New file, from libutf8 with modifications. * m4/wcsrchr.m4: New file. * m4/wchar_h.m4 (gl_WCHAR_H): Test whether wcsrchr is declared. (gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WCSRCHR, HAVE_WCSRCHR. * modules/wchar (Makefile.am): Substitute GNULIB_WCSRCHR, HAVE_WCSRCHR. * tests/test-wchar-c++.cc: Test the declaration of wcsrchr. * doc/posix-functions/wcsrchr.texi: Mention the new module. --- lib/wchar.in.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/wchar.in.h') diff --git a/lib/wchar.in.h b/lib/wchar.in.h index 815180f11e..8eaf4f63d6 100644 --- a/lib/wchar.in.h +++ b/lib/wchar.in.h @@ -787,6 +787,22 @@ _GL_WARN_ON_USE (wcschr, "wcschr is unportable - " #endif +/* Find the last occurrence of WC in WCS. */ +#if @GNULIB_WCSRCHR@ +# if !@HAVE_WCSRCHR@ +_GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc)); +# endif +_GL_CXXALIAS_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc)); +_GL_CXXALIASWARN (wcsrchr); +#elif defined GNULIB_POSIXCHECK +# undef wcsrchr +# if HAVE_RAW_DECL_WCSRCHR +_GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - " + "use gnulib module wcsrchr for portability"); +# endif +#endif + + #endif /* _GL_WCHAR_H */ #endif /* _GL_WCHAR_H */ #endif -- cgit v1.2.1