summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Kientzle <kientzle@gmail.com>2011-11-06 19:51:57 -0500
committerTim Kientzle <kientzle@gmail.com>2011-11-06 19:51:57 -0500
commitecb1ffefc55ba396902aff48223d94d036de1cbc (patch)
treed535ab69238bbfc629a9637a78033a832d60e326
parentf2488cf6d55df8862bda15071dadfa16f81a2ec7 (diff)
downloadlibarchive-ecb1ffefc55ba396902aff48223d94d036de1cbc.tar.gz
Update iconv.m4 to the newest version.
SVN-Revision: 3755
-rw-r--r--build/autoconf/iconv.m430
1 files changed, 21 insertions, 9 deletions
diff --git a/build/autoconf/iconv.m4 b/build/autoconf/iconv.m4
index 425145c0..98fcd64d 100644
--- a/build/autoconf/iconv.m4
+++ b/build/autoconf/iconv.m4
@@ -1,5 +1,5 @@
-# iconv.m4 serial 15 (gettext-0.18.2)
-dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc.
+# iconv.m4 serial 18 (gettext-0.18.2)
+dnl Copyright (C) 2000-2002, 2007-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.
@@ -78,6 +78,7 @@ AC_DEFUN([AM_ICONV_LINK],
#include <string.h>
int main ()
{
+ int result = 0;
/* Test against AIX 5.1 bug: Failures are not distinguishable from successful
returns. */
{
@@ -94,7 +95,8 @@ int main ()
(char **) &inptr, &inbytesleft,
&outptr, &outbytesleft);
if (res == 0)
- return 1;
+ result |= 1;
+ iconv_close (cd_utf8_to_88591);
}
}
/* Test against Solaris 10 bug: Failures are not distinguishable from
@@ -113,7 +115,8 @@ int main ()
(char **) &inptr, &inbytesleft,
&outptr, &outbytesleft);
if (res == 0)
- return 1;
+ result |= 2;
+ iconv_close (cd_ascii_to_88591);
}
}
/* Test against AIX 6.1..7.1 bug: Buffer overrun. */
@@ -131,7 +134,8 @@ int main ()
(char **) &inptr, &inbytesleft,
&outptr, &outbytesleft);
if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
- return 1;
+ result |= 4;
+ iconv_close (cd_88591_to_utf8);
}
}
#if 0 /* This bug could be worked around by the caller. */
@@ -150,7 +154,8 @@ int main ()
(char **) &inptr, &inbytesleft,
&outptr, &outbytesleft);
if ((int)res > 0)
- return 1;
+ result |= 8;
+ iconv_close (cd_88591_to_utf8);
}
}
#endif
@@ -164,8 +169,8 @@ int main ()
&& iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
/* Try HP-UX names. */
&& iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
- return 1;
- return 0;
+ result |= 16;
+ return result;
}]])],
[am_cv_func_iconv_works=yes],
[am_cv_func_iconv_works=no],
@@ -237,7 +242,7 @@ extern
#ifdef __cplusplus
"C"
#endif
-#if defined(__STDC__) || defined(__cplusplus)
+#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
#else
size_t iconv();
@@ -252,5 +257,12 @@ size_t iconv();
$am_cv_proto_iconv])
AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
[Define as const if the declaration of iconv() needs const.])
+ dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
+ m4_ifdef([gl_ICONV_H_DEFAULTS],
+ [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
+ if test -n "$am_cv_proto_iconv_arg1"; then
+ ICONV_CONST="const"
+ fi
+ ])
fi
])