[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gnu-libiconv] Portability fix for libiconv 1.13
From: |
Bruno Haible |
Subject: |
Re: [bug-gnu-libiconv] Portability fix for libiconv 1.13 |
Date: |
Tue, 30 Jun 2009 23:15:14 +0200 |
User-agent: |
KMail/1.9.9 |
Larry Jones wrote:
> There are compile errors in lib/iconv_open2.h if neither HAVE_WCRTOMB
> nor HAVE_MBRTOWC is defined because struct wchar_conv_struct doesn't
> contain a state member unless one of those macros is defined but the
> code in iconv_open2.h accesses it unconditionally. I chose to fix it by
> conditionalizing the access:
>
> --- iconv_open2.h.orig Tue Sep 16 20:26:17 2008
> +++ iconv_open2.h Sat Jun 27 16:33:07 2009
> @@ -82,6 +82,8 @@
> /* Initialize additional fields. */
> if (from_wchar != to_wchar) {
> struct wchar_conv_struct * wcd = (struct wchar_conv_struct *) cd;
> +#if HAVE_WCRTOMB || HAVE_MBRTOWC
> memset(&wcd->state,'\0',sizeof(mbstate_t));
> +#endif
> }
> /* Done. */
Thanks for reporting this. I chose exactly the same fix as you.
Since you are now the third person to report this bug, I've put out
a bugfix release 1.13.1 that fixes this compilation error.
Bruno