+2010-11-26 Bruno Haible <bruno@clisp.org>
+
+ iconv-h: Fix test-iconv-h-c++ failure on Solaris 11 2010-11.
+ * lib/iconv.in.h (iconv_open, iconv, iconv_close): Define only if the
+ 'iconv' module is present.
+ (ICONV_CONST): New macro.
+ * m4/iconv_h.m4 (gl_ICONV_H_DEFAULTS): Initialize GNULIB_ICONV and
+ ICONV_CONST.
+ * m4/iconv.m4 (AM_ICONV): If the gnulib module 'iconv-h' is present,
+ set ICONV_CONST.
+ * m4/iconv_open.m4 (gl_FUNC_ICONV_OPEN_UTF): Don't set ICONV_CONST
+ here.
+ * modules/iconv (configure.ac): Invoke gl_ICONV_MODULE_INDICATOR.
+ * modules/iconv-h (Makefile.am): Substitute GNULIB_ICONV.
+ * tests/test-iconv-h.c (ICONV_CONST): Don't define here.
+ * tests/test-iconv-h-c++.cc (ICONV_CONST): Don't define here.
+ (iconv_open, iconv, iconv_close): Test only if the 'iconv' module is
+ present.
+
2010-11-25 Paul Eggert <eggert@cs.ucla.edu>
ftoastr: comment fix
/* The definition of _GL_WARN_ON_USE is copied here. */
-#if @REPLACE_ICONV_OPEN@
+#if @GNULIB_ICONV@
+# if @REPLACE_ICONV_OPEN@
/* An iconv_open wrapper that supports the IANA standardized encoding names
("ISO-8859-1" etc.) as far as possible. */
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# define iconv_open rpl_iconv_open
-# endif
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define iconv_open rpl_iconv_open
+# endif
_GL_FUNCDECL_RPL (iconv_open, iconv_t,
(const char *tocode, const char *fromcode)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (iconv_open, iconv_t,
(const char *tocode, const char *fromcode));
-#else
+# else
_GL_CXXALIAS_SYS (iconv_open, iconv_t,
(const char *tocode, const char *fromcode));
-#endif
+# endif
_GL_CXXALIASWARN (iconv_open);
+#endif
#if @REPLACE_ICONV_UTF@
/* Special constants for supporting UTF-{16,32}{BE,LE} encodings.
# define _ICONV_UTF32LE_UTF8 (iconv_t)(-168)
#endif
-#if @REPLACE_ICONV@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# define iconv rpl_iconv
-# endif
+#if @GNULIB_ICONV@
+# if @REPLACE_ICONV@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define iconv rpl_iconv
+# endif
_GL_FUNCDECL_RPL (iconv, size_t,
(iconv_t cd,
@ICONV_CONST@ char **inbuf, size_t *inbytesleft,
(iconv_t cd,
@ICONV_CONST@ char **inbuf, size_t *inbytesleft,
char **outbuf, size_t *outbytesleft));
-#else
+# else
_GL_CXXALIAS_SYS (iconv, size_t,
(iconv_t cd,
@ICONV_CONST@ char **inbuf, size_t *inbytesleft,
char **outbuf, size_t *outbytesleft));
-#endif
+# endif
_GL_CXXALIASWARN (iconv);
-
-#if @REPLACE_ICONV@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# define iconv_close rpl_iconv_close
+# ifndef ICONV_CONST
+# define ICONV_CONST @ICONV_CONST@
# endif
+#endif
+
+#if @GNULIB_ICONV@
+# if @REPLACE_ICONV@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define iconv_close rpl_iconv_close
+# endif
_GL_FUNCDECL_RPL (iconv_close, int, (iconv_t cd));
_GL_CXXALIAS_RPL (iconv_close, int, (iconv_t cd));
-#else
+# else
_GL_CXXALIAS_SYS (iconv_close, int, (iconv_t cd));
-#endif
+# endif
_GL_CXXALIASWARN (iconv_close);
+#endif
#endif /* _GL_ICONV_H */
-# iconv.m4 serial 15 (gettext-0.18.2)
+# iconv.m4 serial 16 (gettext-0.18.2)
dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
$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
])
-# iconv_h.m4 serial 6
+# iconv_h.m4 serial 7
dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_DEFUN([gl_ICONV_H_DEFAULTS],
[
+ GNULIB_ICONV=0; AC_SUBST([GNULIB_ICONV])
dnl Assume proper GNU behavior unless another module says otherwise.
+ ICONV_CONST=; AC_SUBST([ICONV_CONST])
REPLACE_ICONV=0; AC_SUBST([REPLACE_ICONV])
REPLACE_ICONV_OPEN=0; AC_SUBST([REPLACE_ICONV_OPEN])
REPLACE_ICONV_UTF=0; AC_SUBST([REPLACE_ICONV_UTF])
-# iconv_open.m4 serial 9
+# iconv_open.m4 serial 10
dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_REQUIRE([gl_ICONV_H_DEFAULTS])
if test "$am_cv_func_iconv" = yes; then
- if test -n "$am_cv_proto_iconv_arg1"; then
- ICONV_CONST="const"
- else
- ICONV_CONST=
- fi
- AC_SUBST([ICONV_CONST])
AC_CACHE_CHECK([whether iconv supports conversion between UTF-8 and UTF-{16,32}{BE,LE}],
[gl_cv_func_iconv_supports_utf],
[
configure.ac:
AM_ICONV
+gl_ICONV_MODULE_INDICATOR([iconv])
Makefile.am:
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_ICONV_H''@|$(NEXT_ICONV_H)|g' \
+ -e 's|@''GNULIB_ICONV''@|$(GNULIB_ICONV)|g' \
-e 's|@''ICONV_CONST''@|$(ICONV_CONST)|g' \
-e 's|@''REPLACE_ICONV''@|$(REPLACE_ICONV)|g' \
-e 's|@''REPLACE_ICONV_OPEN''@|$(REPLACE_ICONV_OPEN)|g' \
#if HAVE_ICONV
# include <iconv.h>
-# ifndef ICONV_CONST
-# define ICONV_CONST /* empty */
-# endif
-
# include "signature.h"
+#if GNULIB_TEST_ICONV
SIGNATURE_CHECK (GNULIB_NAMESPACE::iconv_open, iconv_t,
(const char *, const char *));
+#endif
+#if GNULIB_TEST_ICONV
SIGNATURE_CHECK (GNULIB_NAMESPACE::iconv, size_t,
(iconv_t, ICONV_CONST char **, size_t *, char **, size_t *));
+#endif
+#if GNULIB_TEST_ICONV
SIGNATURE_CHECK (GNULIB_NAMESPACE::iconv_close, int, (iconv_t));
+#endif
#endif
#if HAVE_ICONV
# include <iconv.h>
-
-# ifndef ICONV_CONST
-# define ICONV_CONST /* empty */
-# endif
#endif
int