summaryrefslogtreecommitdiffstats
path: root/gl/m4/mbrtowc.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/mbrtowc.m4')
-rw-r--r--gl/m4/mbrtowc.m465
1 files changed, 34 insertions, 31 deletions
diff --git a/gl/m4/mbrtowc.m4 b/gl/m4/mbrtowc.m4
index 11d7d23..606de5c 100644
--- a/gl/m4/mbrtowc.m4
+++ b/gl/m4/mbrtowc.m4
@@ -1,5 +1,6 @@
1# mbrtowc.m4 serial 15 1# mbrtowc.m4 serial 17
2dnl Copyright (C) 2001-2002, 2004-2005, 2008, 2009 Free Software Foundation, Inc. 2dnl Copyright (C) 2001-2002, 2004-2005, 2008-2010 Free Software Foundation,
3dnl Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -10,38 +11,39 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
10 11
11 AC_REQUIRE([AC_TYPE_MBSTATE_T]) 12 AC_REQUIRE([AC_TYPE_MBSTATE_T])
12 gl_MBSTATE_T_BROKEN 13 gl_MBSTATE_T_BROKEN
13 if test $REPLACE_MBSTATE_T = 1; then 14
14 REPLACE_MBRTOWC=1
15 fi
16 AC_CHECK_FUNCS_ONCE([mbrtowc]) 15 AC_CHECK_FUNCS_ONCE([mbrtowc])
17 if test $ac_cv_func_mbrtowc = no; then 16 if test $ac_cv_func_mbrtowc = no; then
18 HAVE_MBRTOWC=0 17 HAVE_MBRTOWC=0
19 fi 18 else
20 if test $HAVE_MBRTOWC != 0 && test $REPLACE_MBRTOWC != 1; then 19 if test $REPLACE_MBSTATE_T = 1; then
21 gl_MBRTOWC_NULL_ARG 20 REPLACE_MBRTOWC=1
22 gl_MBRTOWC_RETVAL 21 else
23 gl_MBRTOWC_NUL_RETVAL 22 gl_MBRTOWC_NULL_ARG
24 case "$gl_cv_func_mbrtowc_null_arg" in 23 gl_MBRTOWC_RETVAL
25 *yes) ;; 24 gl_MBRTOWC_NUL_RETVAL
26 *) AC_DEFINE([MBRTOWC_NULL_ARG_BUG], [1], 25 case "$gl_cv_func_mbrtowc_null_arg" in
27 [Define if the mbrtowc function has the NULL string argument bug.]) 26 *yes) ;;
28 REPLACE_MBRTOWC=1 27 *) AC_DEFINE([MBRTOWC_NULL_ARG_BUG], [1],
29 ;; 28 [Define if the mbrtowc function has the NULL string argument bug.])
30 esac 29 REPLACE_MBRTOWC=1
31 case "$gl_cv_func_mbrtowc_retval" in 30 ;;
32 *yes) ;; 31 esac
33 *) AC_DEFINE([MBRTOWC_RETVAL_BUG], [1], 32 case "$gl_cv_func_mbrtowc_retval" in
34 [Define if the mbrtowc function returns a wrong return value.]) 33 *yes) ;;
35 REPLACE_MBRTOWC=1 34 *) AC_DEFINE([MBRTOWC_RETVAL_BUG], [1],
36 ;; 35 [Define if the mbrtowc function returns a wrong return value.])
37 esac 36 REPLACE_MBRTOWC=1
38 case "$gl_cv_func_mbrtowc_nul_retval" in 37 ;;
39 *yes) ;; 38 esac
40 *) AC_DEFINE([MBRTOWC_NUL_RETVAL_BUG], [1], 39 case "$gl_cv_func_mbrtowc_nul_retval" in
41 [Define if the mbrtowc function does not return 0 for a NUL character.]) 40 *yes) ;;
42 REPLACE_MBRTOWC=1 41 *) AC_DEFINE([MBRTOWC_NUL_RETVAL_BUG], [1],
43 ;; 42 [Define if the mbrtowc function does not return 0 for a NUL character.])
44 esac 43 REPLACE_MBRTOWC=1
44 ;;
45 esac
46 fi
45 fi 47 fi
46 if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then 48 if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
47 gl_REPLACE_WCHAR_H 49 gl_REPLACE_WCHAR_H
@@ -156,6 +158,7 @@ changequote([,])dnl
156 if test $LOCALE_ZH_CN != none; then 158 if test $LOCALE_ZH_CN != none; then
157 AC_TRY_RUN([ 159 AC_TRY_RUN([
158#include <locale.h> 160#include <locale.h>
161#include <stdlib.h>
159#include <string.h> 162#include <string.h>
160#include <wchar.h> 163#include <wchar.h>
161int main () 164int main ()