]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Avoid gcc warning caused by the use of iconv().
authorBruno Haible <bruno@clisp.org>
Wed, 24 Jan 2001 13:58:23 +0000 (13:58 +0000)
committerBruno Haible <bruno@clisp.org>
Wed, 24 Jan 2001 13:58:23 +0000 (13:58 +0000)
intl/ChangeLog
intl/dcigettext.c
m4/ChangeLog
m4/iconv.m4

index c2ef102fae4687bd5361f84083427a23e8fcd737..581b8d47b7738bd375ff6bd0bad7c3cf79c13950 100644 (file)
@@ -1,3 +1,8 @@
+2001-01-15  Bruno Haible  <haible@clisp.cons.org>
+
+       * dcigettext.c (_nl_find_msg): Cast the second iconv() arg, to avoid
+       a warning.
+
 2001-01-07  Bruno Haible  <haible@clisp.cons.org>
 
        * gettextP.h (__gettextdebug): Remove declaration.
index c9e52a7e83fc38ea1818511614b0e2b64e4e65f6..fc1716e42bd0c2028551c75d6c56d1debdbc6511 100644 (file)
@@ -821,7 +821,9 @@ _nl_find_msg (domain_file, msgid, lengthp)
                goto resize_freemem;
 
              outleft = freemem_size - sizeof (size_t);
-             if (iconv (domain->conv, &inptr, &inleft, &outptr, &outleft)
+             if (iconv (domain->conv,
+                        (ICONV_CONST char **) &inptr, &inleft,
+                        &outptr, &outleft)
                  != (size_t) (-1))
                {
                  outbuf = (unsigned char *) outptr;
index 4af3df57921dd37caed9d5d26342612add99cd80..378f903b4efcfaaca654e485f65f58dffcbdc7bc 100644 (file)
@@ -1,3 +1,13 @@
+2001-01-20  Bruno Haible  <haible@clisp.cons.org>
+
+       * gettext.m4 (AM_WITH_NLS): Add a third argument to AC_DEFINE.
+       * lcmessage.m4 (AM_LC_MESSAGES): Likewise.
+
+2001-01-15  Bruno Haible  <haible@clisp.cons.org>
+
+       * iconv.m4 (AM_ICONV): Also check whether the iconv declaration
+       has const.
+
 2001-01-07  Bruno Haible  <haible@clisp.cons.org>
 
        * gettext.m4 (AM_WITH_NLS): Remove third argument. Don't call
index a23a320c98b832d2d9d52d6c7efa28471c720fb8..eb9f765d6aeccace000c5a8fc68823cfe36d21be 100644 (file)
@@ -30,6 +30,27 @@ AC_DEFUN(AM_ICONV,
   ])
   if test "$am_cv_func_iconv" = yes; then
     AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
+    AC_MSG_CHECKING([for iconv declaration])
+    AC_CACHE_VAL(am_cv_proto_iconv, [
+      AC_TRY_COMPILE([
+#include <stdlib.h>
+#include <iconv.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+#if defined(__STDC__) || defined(__cplusplus)
+size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t* outbytesleft);
+#else
+size_t iconv();
+#endif
+], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
+      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);"])
+    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
+    AC_MSG_RESULT([$]{ac_t:-
+         }[$]am_cv_proto_iconv)
+    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
+      [Define as const if the declaration of iconv() needs const.])
   fi
   LIBICONV=
   if test "$am_cv_lib_iconv" = yes; then