]> Savannah Git Hosting - gnulib.git/commitdiff
Don't treat Apple's new Citrus/FreeBSD-based iconv like GNU libiconv.
authorBruno Haible <bruno@clisp.org>
Wed, 14 Feb 2024 22:44:28 +0000 (23:44 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 14 Feb 2024 22:44:28 +0000 (23:44 +0100)
* m4/iconv_open.m4 (gl_FUNC_ICONV_OPEN): Don't treat the bastard Apple
iconv like GNU libiconv.
* lib/striconv.c (mem_cd_iconv, str_cd_iconv): Likewise.
* lib/striconveh.c (iconv_carefully, iconv_carefully_1,
mem_cd_iconveh_internal): Likewise.
* lib/propername.c (proper_name_utf8): Likewise.
* lib/unicodeio.c (unicode_to_mb): Likewise.
* lib/uniconv/u16-conv-from-enc.c (UTF16_NAME): Likewise.
* lib/uniconv/u16-conv-to-enc.c (UTF16_NAME): Likewise.
* lib/uniconv/u16-strconv-to-enc.c (UTF16_NAME): Likewise.
* lib/uniconv/u32-conv-from-enc.c (UTF32_NAME): Likewise.
* lib/uniconv/u32-conv-to-enc.c (UTF32_NAME): Likewise.
* lib/uniconv/u32-strconv-to-enc.c (UTF32_NAME): Likewise.
* tests/test-striconveh.c (main): Likewise.
* tests/test-striconveha.c (main): Likewise.
* tests/uniconv/test-u8-conv-from-enc.c (main): Likewise.
* tests/uniconv/test-u8-strconv-from-enc.c (main): Likewise.
* tests/uniconv/test-u16-conv-from-enc.c (main): Likewise.
* tests/uniconv/test-u16-strconv-from-enc.c (main): Likewise.
* tests/uniconv/test-u32-conv-from-enc.c (main): Likewise.
* tests/uniconv/test-u32-strconv-from-enc.c (main): Likewise.

20 files changed:
ChangeLog
lib/propername.c
lib/striconv.c
lib/striconveh.c
lib/unicodeio.c
lib/uniconv/u16-conv-from-enc.c
lib/uniconv/u16-conv-to-enc.c
lib/uniconv/u16-strconv-to-enc.c
lib/uniconv/u32-conv-from-enc.c
lib/uniconv/u32-conv-to-enc.c
lib/uniconv/u32-strconv-to-enc.c
m4/iconv_open.m4
tests/test-striconveh.c
tests/test-striconveha.c
tests/uniconv/test-u16-conv-from-enc.c
tests/uniconv/test-u16-strconv-from-enc.c
tests/uniconv/test-u32-conv-from-enc.c
tests/uniconv/test-u32-strconv-from-enc.c
tests/uniconv/test-u8-conv-from-enc.c
tests/uniconv/test-u8-strconv-from-enc.c

index 5d9f15c67724640560ef099cb97ff1117c8cb436..4a7ef0fb85acfbb854b46e45acf6b7f476fc0f9d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2024-02-14  Bruno Haible  <bruno@clisp.org>
+
+       Don't treat Apple's new Citrus/FreeBSD-based iconv like GNU libiconv.
+       * m4/iconv_open.m4 (gl_FUNC_ICONV_OPEN): Don't treat the bastard Apple
+       iconv like GNU libiconv.
+       * lib/striconv.c (mem_cd_iconv, str_cd_iconv): Likewise.
+       * lib/striconveh.c (iconv_carefully, iconv_carefully_1,
+       mem_cd_iconveh_internal): Likewise.
+       * lib/propername.c (proper_name_utf8): Likewise.
+       * lib/unicodeio.c (unicode_to_mb): Likewise.
+       * lib/uniconv/u16-conv-from-enc.c (UTF16_NAME): Likewise.
+       * lib/uniconv/u16-conv-to-enc.c (UTF16_NAME): Likewise.
+       * lib/uniconv/u16-strconv-to-enc.c (UTF16_NAME): Likewise.
+       * lib/uniconv/u32-conv-from-enc.c (UTF32_NAME): Likewise.
+       * lib/uniconv/u32-conv-to-enc.c (UTF32_NAME): Likewise.
+       * lib/uniconv/u32-strconv-to-enc.c (UTF32_NAME): Likewise.
+       * tests/test-striconveh.c (main): Likewise.
+       * tests/test-striconveha.c (main): Likewise.
+       * tests/uniconv/test-u8-conv-from-enc.c (main): Likewise.
+       * tests/uniconv/test-u8-strconv-from-enc.c (main): Likewise.
+       * tests/uniconv/test-u16-conv-from-enc.c (main): Likewise.
+       * tests/uniconv/test-u16-strconv-from-enc.c (main): Likewise.
+       * tests/uniconv/test-u32-conv-from-enc.c (main): Likewise.
+       * tests/uniconv/test-u32-strconv-from-enc.c (main): Likewise.
+
 2024-02-14  Bruno Haible  <bruno@clisp.org>
 
        Improve support of Citrus/FreeBSD iconv.
index d5b52a2c1105a82e213cc2552fc9b20eabb1c62b..7e072d35b689370acc305547b3e28167cfd0753c 100644 (file)
@@ -245,7 +245,7 @@ proper_name_utf8 (const char *name_ascii, const char *name_utf8)
 
         if (converted_translit != NULL)
           {
-#  if !_LIBICONV_VERSION
+#  if !_LIBICONV_VERSION || (_LIBICONV_VERSION == 0x10b && defined __APPLE__)
             /* Don't use the transliteration if it added question marks.
                glibc's transliteration falls back to question marks; libiconv's
                transliteration does not.
index 9688a9fbb11baf0269a04b3c0956ed341bed00bd..f7d9ccf8e237bd35244fef85b1a691771f9d86fb 100644 (file)
@@ -82,11 +82,12 @@ mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
             else
               return -1;
           }
-# if !defined _LIBICONV_VERSION && !(defined __GLIBC__ && !defined __UCLIBC__)
+# if !(defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) \
+     && !(defined __GLIBC__ && !defined __UCLIBC__)
         /* Irix iconv() inserts a NUL byte if it cannot convert.
            NetBSD iconv() inserts a question mark if it cannot convert.
-           Only GNU libiconv and GNU libc are known to prefer to fail rather
-           than doing a lossy conversion.  */
+           Only GNU libiconv (excluding the bastard Apple iconv) and GNU libc
+           are known to prefer to fail rather than doing a lossy conversion.  */
         else if (res > 0)
           {
             errno = EILSEQ;
@@ -158,11 +159,12 @@ mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
             else
               goto fail;
           }
-# if !defined _LIBICONV_VERSION && !(defined __GLIBC__ && !defined __UCLIBC__)
+# if !(defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) \
+     && !(defined __GLIBC__ && !defined __UCLIBC__)
         /* Irix iconv() inserts a NUL byte if it cannot convert.
            NetBSD iconv() inserts a question mark if it cannot convert.
-           Only GNU libiconv and GNU libc are known to prefer to fail rather
-           than doing a lossy conversion.  */
+           Only GNU libiconv (excluding the bastard Apple iconv) and GNU libc
+           are known to prefer to fail rather than doing a lossy conversion.  */
         else if (res > 0)
           {
             errno = EILSEQ;
@@ -206,14 +208,16 @@ str_cd_iconv (const char *src, iconv_t cd)
      to a trailing NUL byte in the output.  But not for UTF-7.  So that this
      function is usable for UTF-7, we have to exclude the NUL byte from the
      conversion and add it by hand afterwards.  */
-# if !defined _LIBICONV_VERSION && !(defined __GLIBC__ && !defined __UCLIBC__)
+# if !(defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) \
+     && !(defined __GLIBC__ && !defined __UCLIBC__)
   /* Irix iconv() inserts a NUL byte if it cannot convert.
      NetBSD iconv() inserts a question mark if it cannot convert.
-     Only GNU libiconv and GNU libc are known to prefer to fail rather
-     than doing a lossy conversion.  For other iconv() implementations,
-     we have to look at the number of irreversible conversions returned;
-     but this information is lost when iconv() returns for an E2BIG reason.
-     Therefore we cannot use the second, faster algorithm.  */
+     Only GNU libiconv (excluding the bastard Apple iconv) and GNU libc are
+     known to prefer to fail rather than doing a lossy conversion.  For other
+     iconv() implementations, we have to look at the number of irreversible
+     conversions returned; but this information is lost when iconv() returns
+     for an E2BIG reason.  Therefore we cannot use the second, faster
+     algorithm.  */
 
   char *result = NULL;
   size_t length = 0;
index 43cc3e11a42dae755df5fc200640ed4d216086b5..db83a1ddca7e56b563900555de51f057999088eb 100644 (file)
@@ -139,11 +139,12 @@ iconveh_close (const iconveh_t *cd)
 /* iconv_carefully is like iconv, except that it stops as soon as it encounters
    a conversion error, and it returns in *INCREMENTED a boolean telling whether
    it has incremented the input pointers past the error location.  */
-# if !defined _LIBICONV_VERSION && !(defined __GLIBC__ && !defined __UCLIBC__)
+# if !(defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) \
+     && !(defined __GLIBC__ && !defined __UCLIBC__)
 /* Irix iconv() inserts a NUL byte if it cannot convert.
    NetBSD iconv() inserts a question mark if it cannot convert.
-   Only GNU libiconv and GNU libc are known to prefer to fail rather
-   than doing a lossy conversion.  */
+   Only GNU libiconv (excluding the bastard Apple iconv) and GNU libc are
+   known to prefer to fail rather than doing a lossy conversion.  */
 static size_t
 iconv_carefully (iconv_t cd,
                  const char **inbuf, size_t *inbytesleft,
@@ -247,11 +248,12 @@ iconv_carefully_1 (iconv_t cd,
 
   *inbuf = inptr;
   *inbytesleft = inptr_end - inptr;
-# if !defined _LIBICONV_VERSION && !(defined __GLIBC__ && !defined __UCLIBC__)
+# if !(defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) \
+     && !(defined __GLIBC__ && !defined __UCLIBC__)
   /* Irix iconv() inserts a NUL byte if it cannot convert.
      NetBSD iconv() inserts a question mark if it cannot convert.
-     Only GNU libiconv and GNU libc are known to prefer to fail rather
-     than doing a lossy conversion.  */
+     Only GNU libiconv (excluding the bastard Apple iconv) and GNU libc are
+     known to prefer to fail rather than doing a lossy conversion.  */
   if (res != (size_t)(-1) && res > 0)
     {
       /* iconv() has already incremented INPTR.  We cannot go back to a
@@ -948,13 +950,15 @@ mem_cd_iconveh_internal (const char *src, size_t srclen,
                               }
                             length = out2ptr - result;
                           }
-# if !defined _LIBICONV_VERSION && !(defined __GLIBC__ && !defined __UCLIBC__)
+# if !(defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) \
+     && !(defined __GLIBC__ && !defined __UCLIBC__)
                         /* IRIX iconv() inserts a NUL byte if it cannot convert.
                            FreeBSD iconv(), NetBSD iconv(), and Solaris 11
                            iconv() insert a '?' if they cannot convert.
                            musl libc iconv() inserts a '*' if it cannot convert.
-                           Only GNU libiconv and GNU libc are known to prefer
-                           to fail rather than doing a lossy conversion.  */
+                           Only GNU libiconv (excluding the bastard Apple iconv)
+                           and GNU libc are known to prefer to fail rather than
+                           doing a lossy conversion.  */
                         if (res != (size_t)(-1) && res > 0)
                           {
                             errno = EILSEQ;
index 565c98c65d43a1bae4df32d69f08c20e5410d035..9ed3875f93900d488b27643446e35e2b9368e56a 100644 (file)
@@ -144,7 +144,7 @@ unicode_to_mb (unsigned int code,
 # endif
           /* FreeBSD iconv(), NetBSD iconv(), and Solaris 11 iconv() insert
              a '?' if they cannot convert.  */
-# if !defined _LIBICONV_VERSION
+# if !defined _LIBICONV_VERSION || (_LIBICONV_VERSION == 0x10b && defined __APPLE__)
           || (res > 0 && outptr - outbuf == 1 && *outbuf == '?')
 # endif
           /* musl libc iconv() inserts a '*' if it cannot convert.  */
index aa94e915f5ad9bc36b0366e3a26426c4dc1d0497..272cba3f0e0f13570b8ce6dd3ab62f9a086651f9 100644 (file)
@@ -36,7 +36,8 @@
 #include "unistr.h"
 
 /* Name of UTF-16 encoding with machine dependent endianness and alignment.  */
-#if defined _LIBICONV_VERSION || (((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && !defined __UCLIBC__)
+#if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) \
+    || (((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && !defined __UCLIBC__)
 # ifdef WORDS_BIGENDIAN
 #  define UTF16_NAME "UTF-16BE"
 # else
index 4f8aa8a443a76bd7beccfa01920c1dc2428ca5ff..08f4e0632475aa353b2f9e107e12e37d67ae4369 100644 (file)
@@ -39,7 +39,8 @@
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
 
 /* Name of UTF-16 encoding with machine dependent endianness and alignment.  */
-#if defined _LIBICONV_VERSION || (((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && !defined __UCLIBC__)
+#if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) \
+    || (((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && !defined __UCLIBC__)
 # ifdef WORDS_BIGENDIAN
 #  define UTF16_NAME "UTF-16BE"
 # else
index 4455dd5101d65fd88c5e361167764a09a9842cd7..7a5ab81848f0b359d32d56e85390a729a76dd2b6 100644 (file)
@@ -39,7 +39,8 @@
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
 
 /* Name of UTF-16 encoding with machine dependent endianness and alignment.  */
-#if defined _LIBICONV_VERSION || (((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && !defined __UCLIBC__)
+#if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) \
+    || (((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && !defined __UCLIBC__)
 # ifdef WORDS_BIGENDIAN
 #  define UTF16_NAME "UTF-16BE"
 # else
index 9d4ac530d195c7ff7e3aaaeefada3ee7768648ae..6e5f04958b2f32dcfe7f775b2d075b383222cac9 100644 (file)
@@ -37,7 +37,7 @@
 
 /* Name of UTF-32 or UCS-4 encoding with machine dependent endianness and
    alignment.  */
-#if defined _LIBICONV_VERSION
+#if defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)
 # define UTF32_NAME "UCS-4-INTERNAL"
 #elif ((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && !defined __UCLIBC__
 # define UTF32_NAME "WCHAR_T"
index 6fcd1325136ea434d87ded07c33c9c62bd4bd1b9..e446c6920c8897c743fc2e9abc7e66cf527bce12 100644 (file)
@@ -40,7 +40,7 @@
 
 /* Name of UTF-32 or UCS-4 encoding with machine dependent endianness and
    alignment.  */
-#if defined _LIBICONV_VERSION
+#if defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)
 # define UTF32_NAME "UCS-4-INTERNAL"
 #elif ((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && !defined __UCLIBC__
 # define UTF32_NAME "WCHAR_T"
index 848318e6100b5e1b1da990c89e07cf9a81bea838..c7fb3f0d24a002fdc4e9b9c6eedc446736f10115 100644 (file)
@@ -40,7 +40,7 @@
 
 /* Name of UTF-32 or UCS-4 encoding with machine dependent endianness and
    alignment.  */
-#if defined _LIBICONV_VERSION
+#if defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)
 # define UTF32_NAME "UCS-4-INTERNAL"
 #elif ((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && !defined __UCLIBC__
 # define UTF32_NAME "WCHAR_T"
index d4fd3ab7f6101306b7fc3f72a893068a9ecc69ad..c6fe346bd4f1f001b973678d246971b47c698153 100644 (file)
@@ -1,4 +1,4 @@
-# iconv_open.m4 serial 16
+# iconv_open.m4 serial 17
 dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -16,7 +16,8 @@ AC_DEFUN([gl_FUNC_ICONV_OPEN],
     dnl We know that GNU libiconv and GNU libc do.
     AC_EGREP_CPP([gnu_iconv], [
       #include <iconv.h>
-      #if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
+      #if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) \
+          || (defined __GLIBC__ && !defined __UCLIBC__)
        gnu_iconv
       #endif
       ], [gl_func_iconv_gnu=yes], [gl_func_iconv_gnu=no])
index eb8a3e2b74053626245fa5f2815f3c94e5e0b0af..71dfc3f73f3d6948ffd099b929b0746905f50c33 100644 (file)
@@ -68,7 +68,7 @@ main ()
   iconv_t cd_88592_to_utf8 = iconv_open ("UTF-8", "ISO-8859-2");
   iconv_t cd_utf8_to_88592 = iconv_open ("ISO-8859-2", "UTF-8");
   iconv_t cd_utf7_to_utf8 = iconv_open ("UTF-8", "UTF-7");
-# if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) || (defined __GLIBC__ && !defined __UCLIBC__)
   iconv_t cd_ascii_to_gb18030 = iconv_open ("GB18030", "ASCII");
   iconv_t cd_utf8_to_gb18030 = iconv_open ("GB18030", "UTF-8");
   iconv_t cd_88591_to_gb18030 = iconv_open ("GB18030", "ISO-8859-1");
@@ -82,7 +82,7 @@ main ()
   iconveh_t cdeh_88591_to_utf8;
   iconveh_t cdeh_utf8_to_88591;
   iconveh_t cdeh_utf7_to_utf8;
-# if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) || (defined __GLIBC__ && !defined __UCLIBC__)
   iconveh_t cdeh_ascii_to_gb18030;
   iconveh_t cdeh_88591_to_gb18030;
   iconveh_t cdeh_utf7_to_gb18030;
@@ -93,7 +93,7 @@ main ()
   ASSERT (cd_utf8_to_88591 != (iconv_t)(-1));
   ASSERT (cd_88592_to_utf8 != (iconv_t)(-1));
   ASSERT (cd_utf8_to_88592 != (iconv_t)(-1));
-# if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) || (defined __GLIBC__ && !defined __UCLIBC__)
   ASSERT (cd_ascii_to_gb18030 != (iconv_t)(-1));
   ASSERT (cd_utf8_to_gb18030 != (iconv_t)(-1));
 # endif
@@ -130,7 +130,7 @@ main ()
   cdeh_utf7_to_utf8.cd1 = cd_utf7_to_utf8;
   cdeh_utf7_to_utf8.cd2 = (iconv_t)(-1);
 
-# if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) || (defined __GLIBC__ && !defined __UCLIBC__)
   cdeh_ascii_to_gb18030.cd = cd_ascii_to_gb18030;
   cdeh_ascii_to_gb18030.cd1 = cd_ascii_to_utf8;
   cdeh_ascii_to_gb18030.cd2 = cd_utf8_to_gb18030;
@@ -330,7 +330,7 @@ main ()
         }
     }
 
-# if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) || (defined __GLIBC__ && !defined __UCLIBC__)
   /* Test conversion from ISO-8859-1 to GB18030 with no errors.  */
   for (h = 0; h < SIZEOF (handlers); h++)
     {
@@ -462,7 +462,7 @@ main ()
         }
     }
 
-# if defined _LIBICONV_VERSION || ((__GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2) && !defined __UCLIBC__)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) || ((__GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2) && !defined __UCLIBC__)
   /* Test conversion from ASCII to GB18030 with invalid input (EILSEQ).
      Note: glibc's GB18030 converter was buggy in glibc-2.15; fixed by
      Andreas Schwab on 2012-02-06.  */
@@ -648,7 +648,7 @@ main ()
           free (result);
         }
 
-#  if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
+#  if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) || (defined __GLIBC__ && !defined __UCLIBC__)
       /* Test conversion from UTF-7 to GB18030 with EINVAL.  */
       for (h = 0; h < SIZEOF (handlers); h++)
         {
@@ -748,7 +748,7 @@ main ()
             }
         }
 
-#   if defined _LIBICONV_VERSION || ((__GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2) && !defined __UCLIBC__)
+#   if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) || ((__GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2) && !defined __UCLIBC__)
       /* Test conversion from UTF-7 to GB18030 with EILSEQ.
          Note: glibc's GB18030 converter was buggy in glibc-2.15; fixed by
          Andreas Schwab on 2012-02-06.  */
@@ -926,7 +926,7 @@ main ()
       free (result);
     }
 
-# if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) || (defined __GLIBC__ && !defined __UCLIBC__)
   /* Test conversion from ISO-8859-1 to GB18030 with no errors.  */
   for (h = 0; h < SIZEOF (handlers); h++)
     {
@@ -989,7 +989,7 @@ main ()
         }
     }
 
-# if defined _LIBICONV_VERSION || ((__GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2) && !defined __UCLIBC__)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) || ((__GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2) && !defined __UCLIBC__)
   /* Test conversion from ASCII to GB18030 with invalid input (EILSEQ).
      Note: glibc's GB18030 converter was buggy in glibc-2.15; fixed by
      Andreas Schwab on 2012-02-06.  */
@@ -1207,7 +1207,7 @@ main ()
         }
     }
 
-# if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) || (defined __GLIBC__ && !defined __UCLIBC__)
   /* Test conversion from ISO-8859-1 to GB18030 with no errors.  */
   for (h = 0; h < SIZEOF (handlers); h++)
     {
@@ -1427,7 +1427,7 @@ main ()
       free (result);
     }
 
-# if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) || (defined __GLIBC__ && !defined __UCLIBC__)
   /* Test conversion from ISO-8859-1 to GB18030 with no errors.  */
   for (h = 0; h < SIZEOF (handlers); h++)
     {
index 657ec127c45a7aca2f38724b865dc3ce54bb923c..c401177e29dd31986420be2ee5ad7d42541dfea0 100644 (file)
@@ -308,7 +308,8 @@ main ()
     }
 
   /* autodetect_jp is only supported when iconv() support ISO-2022-JP-2.  */
-# if defined _LIBICONV_VERSION || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__ || defined __sun)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) \
+     || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__ || defined __sun)
   if (iconv_supports_encoding ("ISO-2022-JP-2"))
     {
       /* Test conversions from autodetect_jp to UTF-8.  */
@@ -547,7 +548,8 @@ main ()
     }
 
   /* autodetect_jp is only supported when iconv() support ISO-2022-JP-2.  */
-# if defined _LIBICONV_VERSION || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__ || defined __sun)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) \
+     || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__ || defined __sun)
   if (iconv_supports_encoding ("ISO-2022-JP-2"))
     {
       /* Test conversions from autodetect_jp to UTF-8.  */
index c917445335b75018ff368fa957c8fdfc2b18d824..48c7fd7760bcc8623d363cc6209d305b946ecc00 100644 (file)
@@ -117,7 +117,8 @@ main ()
     }
 
   /* autodetect_jp is only supported when iconv() support ISO-2022-JP-2.  */
-# if defined _LIBICONV_VERSION || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__ || defined __sun)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) \
+     || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__ || defined __sun)
   if (iconv_supports_encoding ("ISO-2022-JP-2"))
     {
       /* Test conversions from autodetect_jp to UTF-16.  */
index 495112aed7acfc3784c64644a2897570683a2298..b1cb1a881a63d08d9939faefe699a0050aa635b2 100644 (file)
@@ -71,7 +71,8 @@ main ()
     }
 
   /* autodetect_jp is only supported when iconv() support ISO-2022-JP-2.  */
-# if defined _LIBICONV_VERSION || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__ || defined __sun)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) \
+     || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__ || defined __sun)
   if (iconv_supports_encoding ("ISO-2022-JP-2"))
     {
       /* Test conversions from autodetect_jp to UTF-16.  */
index e9e34def5fbf1b985f167c78f87cf203af511646..994bfb49fdaedaaa595ba66844d8faf1296b26cd 100644 (file)
@@ -117,7 +117,8 @@ main ()
     }
 
   /* autodetect_jp is only supported when iconv() support ISO-2022-JP-2.  */
-# if defined _LIBICONV_VERSION || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__ || defined __sun)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) \
+     || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__ || defined __sun)
   if (iconv_supports_encoding ("ISO-2022-JP-2"))
     {
       /* Test conversions from autodetect_jp to UTF-16.  */
index 0b03a245bd8a266b6c3365c5ec37d3dbd1fd467d..320bc185cda07ff9c074ac532c57100e9ad94423 100644 (file)
@@ -71,7 +71,8 @@ main ()
     }
 
   /* autodetect_jp is only supported when iconv() support ISO-2022-JP-2.  */
-# if defined _LIBICONV_VERSION || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__ || defined __sun)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) \
+     || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__ || defined __sun)
   if (iconv_supports_encoding ("ISO-2022-JP-2"))
     {
       /* Test conversions from autodetect_jp to UTF-16.  */
index e663aae3472f86c258a73cad91dadd43759d1c9e..641200f2b5a391cc3d28d0e9825fa2a0f7561442 100644 (file)
@@ -112,7 +112,8 @@ main ()
     }
 
   /* autodetect_jp is only supported when iconv() support ISO-2022-JP-2.  */
-# if defined _LIBICONV_VERSION || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__ || defined __sun)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) \
+     || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__ || defined __sun)
   if (iconv_supports_encoding ("ISO-2022-JP-2"))
     {
       /* Test conversions from autodetect_jp to UTF-8.  */
index cd1b44e000e9bbe19c7d1f3fcaf951281c9e55de..61e3230ba635e7e54eb955e34b3188d51c16f648 100644 (file)
@@ -62,7 +62,8 @@ main ()
     }
 
   /* autodetect_jp is only supported when iconv() support ISO-2022-JP-2.  */
-# if defined _LIBICONV_VERSION || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__ || defined __sun)
+# if (defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) \
+     || !(defined _AIX || defined __sgi || defined __hpux || defined __osf__ || defined __sun)
   if (iconv_supports_encoding ("ISO-2022-JP-2"))
     {
       /* Test conversions from autodetect_jp to UTF-8.  */