2024-09-09 Bruno Haible <bruno@clisp.org>
+ striconv, striconveh, unicodeio: Drop workaround for glibc 2.1.
+ * lib/striconv.c (mem_cd_iconv, str_iconv): Remove glibc-2.1 and
+ Solaris 9 bug workarounds.
+ * lib/striconveh.c (mem_cd_iconveh_internal): Likewise.
+ * lib/unicodeio.c (unicode_to_mb): Likewise.
+
striconv, striconveh: Drop workaround for glibc 2.1.
* lib/striconv.c (str_iconv): Remove glibc-2.1 bug workaround.
* lib/striconveh.c (iconveh_open): Likewise.
size_t length;
char *result;
- /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug. */
-# if defined _LIBICONV_VERSION \
- || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
- || defined __sun)
/* Set to the initial state. */
iconv (cd, NULL, NULL, NULL, NULL);
-# endif
/* Determine the length we need. */
{
# endif
count += outptr - tmpbuf;
}
- /* Avoid glibc-2.1 bug and Solaris 2.7 bug. */
-# if defined _LIBICONV_VERSION \
- || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
- || defined __sun)
{
char *outptr = tmpbuf;
size_t outsize = tmpbufsize;
return -1;
count += outptr - tmpbuf;
}
-# endif
length = count;
# undef tmpbuf
}
}
}
- /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug. */
-# if defined _LIBICONV_VERSION \
- || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
- || defined __sun)
/* Return to the initial state. */
iconv (cd, NULL, NULL, NULL, NULL);
-# endif
/* Do the conversion for real. */
{
}
# endif
}
- /* Avoid glibc-2.1 bug and Solaris 2.7 bug. */
-# if defined _LIBICONV_VERSION \
- || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
- || defined __sun)
{
size_t res = iconv (cd, NULL, NULL, &outptr, &outsize);
if (res == (size_t)(-1))
goto fail;
}
-# endif
if (outsize != 0)
abort ();
}
return NULL;
}
- /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug. */
-# if defined _LIBICONV_VERSION \
- || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
- || defined __sun)
/* Set to the initial state. */
iconv (cd, NULL, NULL, NULL, NULL);
-# endif
/* Do the conversion. */
{
else
break;
}
- /* Avoid glibc-2.1 bug and Solaris 2.7 bug. */
-# if defined _LIBICONV_VERSION \
- || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
- || defined __sun)
for (;;)
{
/* Here outptr + outbytes_remaining = result + result_size - 1. */
else
break;
}
-# endif
/* Add the terminating NUL byte. */
*outptr++ = '\0';
const char *inptr = src;
size_t insize = srclen;
- /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug. */
-# if defined _LIBICONV_VERSION \
- || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
- || defined __sun)
/* Set to the initial state. */
iconv (cd, NULL, NULL, NULL, NULL);
-# endif
while (insize > 0)
{
bool do_final_flush1 = true;
bool do_final_flush2 = true;
- /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug. */
-# if defined _LIBICONV_VERSION \
- || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
- || defined __sun)
/* Set to the initial state. */
if (cd1 != (iconv_t)(-1))
iconv (cd1, NULL, NULL, NULL, NULL);
if (cd2 != (iconv_t)(-1))
iconv (cd2, NULL, NULL, NULL, NULL);
-# endif
while (in1size > 0 || do_final_flush1 || utf8len > 0 || do_final_flush2)
{
)
return failure (code, NULL, callback_arg);
- /* Avoid glibc-2.1 bug and Solaris 7 bug. */
-# if defined _LIBICONV_VERSION \
- || !(((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) \
- && !defined __UCLIBC__) \
- || defined __sun)
-
/* Get back to the initial shift state. */
res = iconv (utf8_to_local, NULL, NULL, &outptr, &outbytesleft);
if (res == (size_t)(-1))
return failure (code, NULL, callback_arg);
-# endif
return success (outbuf, outptr - outbuf, callback_arg);
}