New module 'mbsnrtowcs'.
[gnulib.git] / m4 / mbsnrtowcs.m4
1 # mbsnrtowcs.m4 serial 1
2 dnl Copyright (C) 2008 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 AC_DEFUN([gl_FUNC_MBSNRTOWCS],
8 [
9   AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
10
11   dnl Persuade glibc <wchar.h> to declare mbsnrtowcs().
12   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
13
14   AC_REQUIRE([AC_TYPE_MBSTATE_T])
15   gl_MBSTATE_T_BROKEN
16   if test $REPLACE_MBSTATE_T = 1; then
17     REPLACE_MBSNRTOWCS=1
18   fi
19   AC_CHECK_FUNCS_ONCE([mbsnrtowcs])
20   if test $ac_cv_func_mbsnrtowcs = no; then
21     HAVE_MBSNRTOWCS=0
22   fi
23   if test $HAVE_MBSNRTOWCS = 0 || test $REPLACE_MBSNRTOWCS = 1; then
24     gl_REPLACE_WCHAR_H
25     AC_LIBOBJ([mbsnrtowcs])
26     AC_LIBOBJ([mbsrtowcs-state])
27     gl_PREREQ_MBSNRTOWCS
28   fi
29 ])
30
31 # Prerequisites of lib/mbsnrtowcs.c.
32 AC_DEFUN([gl_PREREQ_MBSNRTOWCS], [
33   :
34 ])