summaryrefslogtreecommitdiffstats
path: root/gl/m4/iconv.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/iconv.m4')
-rw-r--r--gl/m4/iconv.m429
1 files changed, 24 insertions, 5 deletions
diff --git a/gl/m4/iconv.m4 b/gl/m4/iconv.m4
index 3cc62682..f46ff142 100644
--- a/gl/m4/iconv.m4
+++ b/gl/m4/iconv.m4
@@ -1,5 +1,5 @@
1# iconv.m4 serial AM7 (gettext-0.18) 1# iconv.m4 serial 9 (gettext-0.18)
2dnl Copyright (C) 2000-2002, 2007-2009 Free Software Foundation, Inc. 2dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -58,7 +58,7 @@ AC_DEFUN([AM_ICONV_LINK],
58 ]) 58 ])
59 if test "$am_cv_func_iconv" = yes; then 59 if test "$am_cv_func_iconv" = yes; then
60 AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ 60 AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
61 dnl This tests against bugs in AIX 5.1 and HP-UX 11.11. 61 dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10.
62 am_save_LIBS="$LIBS" 62 am_save_LIBS="$LIBS"
63 if test $am_cv_lib_iconv = yes; then 63 if test $am_cv_lib_iconv = yes; then
64 LIBS="$LIBS $LIBICONV" 64 LIBS="$LIBS $LIBICONV"
@@ -87,6 +87,25 @@ int main ()
87 return 1; 87 return 1;
88 } 88 }
89 } 89 }
90 /* Test against Solaris 10 bug: Failures are not distinguishable from
91 successful returns. */
92 {
93 iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
94 if (cd_ascii_to_88591 != (iconv_t)(-1))
95 {
96 static const char input[] = "\263";
97 char buf[10];
98 const char *inptr = input;
99 size_t inbytesleft = strlen (input);
100 char *outptr = buf;
101 size_t outbytesleft = sizeof (buf);
102 size_t res = iconv (cd_ascii_to_88591,
103 (char **) &inptr, &inbytesleft,
104 &outptr, &outbytesleft);
105 if (res == 0)
106 return 1;
107 }
108 }
90#if 0 /* This bug could be worked around by the caller. */ 109#if 0 /* This bug could be worked around by the caller. */
91 /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ 110 /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
92 { 111 {
@@ -172,8 +191,8 @@ size_t iconv();
172], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) 191], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"])
173 am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) 192 am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
174 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` 193 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
175 AC_MSG_RESULT([${ac_t:- 194 AC_MSG_RESULT([
176 }$am_cv_proto_iconv]) 195 $am_cv_proto_iconv])
177 AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], 196 AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
178 [Define as const if the declaration of iconv() needs const.]) 197 [Define as const if the declaration of iconv() needs const.])
179 fi 198 fi