bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

c32rtomb: Add a sanity check, working around Solaris 11 OmniOS


From: Bruno Haible
Subject: c32rtomb: Add a sanity check, working around Solaris 11 OmniOS
Date: Sun, 09 Jun 2024 19:28:31 +0200

On a Solaris 11 OmniOS machine with a zh_CN.GB18030 locale, libunistring
(or a testdir without module 'uchar-c23') shows 8 test failures:


FAIL: test-c32isalnum.sh
========================

../../gltests/test-c32isalnum.c:224: assertion 'is == 0' failed
Stack trace:
0x4048fc main
        ../../gltests/test-c32isalnum.c:224
../../gltests/test-c32isalnum.c:235: assertion 'is == 0' failed
Stack trace:
0x4048bd main
        ../../gltests/test-c32isalnum.c:235
FAIL test-c32isalnum.sh (exit status: 1)

...

FAIL: test-c32rtomb.sh
======================

../../gltests/test-c32rtomb.c:48: assertion 'ret == n' failed
Stack trace:
0x40423a check_character
        ../../gltests/test-c32rtomb.c:48
0x404617 main
        ../../gltests/test-c32rtomb.c:169
...

The problem here is that a char32_t produced by mbrtoc32 is not
accepted by the c32rtomb function; the latter returns (size_t)(-1).

For Gnulib's purposes, a char32_t that cannot be converted back to
multibyte is unusable. In this case, we are better off using wchar_t,
assuming that wcrtomb acts as the inverse of mbrtowc.

This patch adds a workaround. Is fixes all these 8 test failures.


2024-06-09  Bruno Haible  <bruno@clisp.org>

        c32rtomb: Add a sanity check, working around Solaris 11 OmniOS.
        * m4/c32rtomb.m4 (gl_CHECK_FUNC_C32RTOMB): New macro, extracted from
        gl_FUNC_C32RTOMB.
        (gl_C32RTOMB_SANITYCHECK): New macro.
        (gl_FUNC_C32RTOMB): Require gl_CHECK_FUNC_C32RTOMB and
        gl_C32RTOMB_SANITYCHECK. If HAVE_WORKING_C32RTOMB is 0, set
        REPLACE_C32RTOMB.
        * lib/c32rtomb.c (c32rtomb): Together with HAVE_WORKING_MBRTOC32, test
        also HAVE_WORKING_C32RTOMB.
        --
        * m4/mbrtoc32.m4 (gl_PREREQ_MBRTOC32): Require gl_C32RTOMB_SANITYCHECK.
        * lib/mbrtoc32.c (mbrtoc32): Together with HAVE_WORKING_MBRTOC32, test
        also HAVE_WORKING_C32RTOMB.
        * modules/mbrtoc32 (Files): Add m4/c32rtomb.m4.
        --
        * lib/btoc32.c (btoc32): Together with HAVE_WORKING_MBRTOC32, test also
        HAVE_WORKING_C32RTOMB.
        --
        * lib/mbsrtoc32s.c: Together with HAVE_WORKING_MBRTOC32, test also
        HAVE_WORKING_C32RTOMB.
        --
        * lib/mbsnrtoc32s.c: Together with HAVE_WORKING_MBRTOC32, test also
        HAVE_WORKING_C32RTOMB.
        --
        * lib/c32tob.c (c32tob): Together with HAVE_WORKING_MBRTOC32, test also
        HAVE_WORKING_C32RTOMB.
        * modules/c32tob (Files): Add m4/c32rtomb.m4.
        (configure.ac): Require gl_C32RTOMB_SANITYCHECK.
        --
        * lib/c32srtombs.c: Together with HAVE_WORKING_MBRTOC32, test also
        HAVE_WORKING_C32RTOMB.
        --
        * lib/c32snrtombs.c: Together with HAVE_WORKING_MBRTOC32, test also
        HAVE_WORKING_C32RTOMB.
        --
        * lib/c32is-impl.h (FUNC): Together with HAVE_WORKING_MBRTOC32, test
        also HAVE_WORKING_C32RTOMB.
        * modules/c32isalnum (Files): Add m4/c32rtomb.m4.
        (configure.ac): Require gl_C32RTOMB_SANITYCHECK.
        * modules/c32isalpha (Files): Add m4/c32rtomb.m4.
        (configure.ac): Require gl_C32RTOMB_SANITYCHECK.
        * modules/c32isblank (Files): Add m4/c32rtomb.m4.
        (configure.ac): Require gl_C32RTOMB_SANITYCHECK.
        * modules/c32iscntrl (Files): Add m4/c32rtomb.m4.
        (configure.ac): Require gl_C32RTOMB_SANITYCHECK.
        * modules/c32isdigit (Files): Add m4/c32rtomb.m4.
        (configure.ac): Require gl_C32RTOMB_SANITYCHECK.
        * modules/c32isgraph (Files): Add m4/c32rtomb.m4.
        (configure.ac): Require gl_C32RTOMB_SANITYCHECK.
        * modules/c32islower (Files): Add m4/c32rtomb.m4.
        (configure.ac): Require gl_C32RTOMB_SANITYCHECK.
        * modules/c32isprint (Files): Add m4/c32rtomb.m4.
        (configure.ac): Require gl_C32RTOMB_SANITYCHECK.
        * modules/c32ispunct (Files): Add m4/c32rtomb.m4.
        (configure.ac): Require gl_C32RTOMB_SANITYCHECK.
        * modules/c32isspace (Files): Add m4/c32rtomb.m4.
        (configure.ac): Require gl_C32RTOMB_SANITYCHECK.
        * modules/c32isupper (Files): Add m4/c32rtomb.m4.
        (configure.ac): Require gl_C32RTOMB_SANITYCHECK.
        * modules/c32isxdigit (Files): Add m4/c32rtomb.m4.
        (configure.ac): Require gl_C32RTOMB_SANITYCHECK.
        --
        * lib/c32to-impl.h (FUNC): Together with HAVE_WORKING_MBRTOC32, test
        also HAVE_WORKING_C32RTOMB.
        * modules/c32tolower (Files): Add m4/c32rtomb.m4.
        (configure.ac): Require gl_C32RTOMB_SANITYCHECK.
        * modules/c32toupper (Files): Add m4/c32rtomb.m4.
        (configure.ac): Require gl_C32RTOMB_SANITYCHECK.
        --
        * lib/c32width.c (c32width): Together with HAVE_WORKING_MBRTOC32, test
        also HAVE_WORKING_C32RTOMB.
        * modules/c32width (Files): Add m4/c32rtomb.m4.
        (configure.ac): Require gl_C32RTOMB_SANITYCHECK.

diff --git a/lib/btoc32.c b/lib/btoc32.c
index 4f223059a7..469148c9dc 100644
--- a/lib/btoc32.c
+++ b/lib/btoc32.c
@@ -36,7 +36,7 @@ _GL_EXTERN_INLINE
 wint_t
 btoc32 (int c)
 {
-#if HAVE_WORKING_MBRTOC32 && !_GL_WCHAR_T_IS_UCS4
+#if HAVE_WORKING_MBRTOC32 && HAVE_WORKING_C32RTOMB && !_GL_WCHAR_T_IS_UCS4
   /* The char32_t encoding of a multibyte character may be different than its
      wchar_t encoding.  */
   if (c != EOF)
diff --git a/lib/c32is-impl.h b/lib/c32is-impl.h
index 084b3a02cf..9e9802583f 100644
--- a/lib/c32is-impl.h
+++ b/lib/c32is-impl.h
@@ -57,7 +57,7 @@ FUNC (wint_t wc)
   else
     return 0;
 
-#elif HAVE_WORKING_MBRTOC32             /* glibc, Android */
+#elif HAVE_WORKING_MBRTOC32 && HAVE_WORKING_C32RTOMB /* glibc, Android */
   /* mbrtoc32() is essentially defined by the system libc.  */
 
 # if _GL_WCHAR_T_IS_UCS4
diff --git a/lib/c32rtomb.c b/lib/c32rtomb.c
index 260bf097f7..c899af1b2e 100644
--- a/lib/c32rtomb.c
+++ b/lib/c32rtomb.c
@@ -36,7 +36,7 @@ size_t
 c32rtomb (char *s, char32_t wc, mbstate_t *ps)
 #undef c32rtomb
 {
-#if HAVE_WORKING_MBRTOC32
+#if HAVE_WORKING_MBRTOC32 && HAVE_WORKING_C32RTOMB
 
 # if C32RTOMB_RETVAL_BUG
   if (s == NULL)
diff --git a/lib/c32snrtombs.c b/lib/c32snrtombs.c
index 23371c4b1e..3a0efdfc4d 100644
--- a/lib/c32snrtombs.c
+++ b/lib/c32snrtombs.c
@@ -24,7 +24,7 @@
 
 #include <wchar.h>
 
-#if (HAVE_WORKING_MBRTOC32 && !_GL_WCHAR_T_IS_UCS4) || (GL_CHAR32_T_IS_UNICODE 
&& GL_CHAR32_T_VS_WCHAR_T_NEEDS_CONVERSION) || _GL_SMALL_WCHAR_T
+#if (HAVE_WORKING_MBRTOC32 && HAVE_WORKING_C32RTOMB && !_GL_WCHAR_T_IS_UCS4) 
|| (GL_CHAR32_T_IS_UNICODE && GL_CHAR32_T_VS_WCHAR_T_NEEDS_CONVERSION) || 
_GL_SMALL_WCHAR_T
 /* The char32_t encoding of a multibyte character may be different than its
    wchar_t encoding, or char32_t is wider than wchar_t.  */
 
diff --git a/lib/c32srtombs.c b/lib/c32srtombs.c
index 4fc3bb1b9b..7cc6f26d04 100644
--- a/lib/c32srtombs.c
+++ b/lib/c32srtombs.c
@@ -24,7 +24,7 @@
 
 #include <wchar.h>
 
-#if (HAVE_WORKING_MBRTOC32 && !_GL_WCHAR_T_IS_UCS4) || (GL_CHAR32_T_IS_UNICODE 
&& GL_CHAR32_T_VS_WCHAR_T_NEEDS_CONVERSION) || _GL_SMALL_WCHAR_T
+#if (HAVE_WORKING_MBRTOC32 && HAVE_WORKING_C32RTOMB && !_GL_WCHAR_T_IS_UCS4) 
|| (GL_CHAR32_T_IS_UNICODE && GL_CHAR32_T_VS_WCHAR_T_NEEDS_CONVERSION) || 
_GL_SMALL_WCHAR_T
 /* The char32_t encoding of a multibyte character may be different than its
    wchar_t encoding, or char32_t is wider than wchar_t.  */
 
diff --git a/lib/c32to-impl.h b/lib/c32to-impl.h
index e94fa7dc9c..32039c612d 100644
--- a/lib/c32to-impl.h
+++ b/lib/c32to-impl.h
@@ -53,7 +53,7 @@ FUNC (wint_t wc)
   else
     return wc;
 
-#elif HAVE_WORKING_MBRTOC32             /* glibc, Android */
+#elif HAVE_WORKING_MBRTOC32 && HAVE_WORKING_C32RTOMB /* glibc, Android */
   /* mbrtoc32() is essentially defined by the system libc.  */
 
 # if _GL_WCHAR_T_IS_UCS4
diff --git a/lib/c32tob.c b/lib/c32tob.c
index 901c9249f8..eb817cc0cc 100644
--- a/lib/c32tob.c
+++ b/lib/c32tob.c
@@ -36,7 +36,7 @@ _GL_EXTERN_INLINE
 int
 c32tob (wint_t wc)
 {
-#if HAVE_WORKING_MBRTOC32 && !_GL_WCHAR_T_IS_UCS4
+#if HAVE_WORKING_MBRTOC32 && HAVE_WORKING_C32RTOMB && !_GL_WCHAR_T_IS_UCS4
   /* The char32_t encoding of a multibyte character may be different than its
      wchar_t encoding.  */
   if (wc != WEOF)
diff --git a/lib/c32width.c b/lib/c32width.c
index 7edf0088f9..37ce1a57dc 100644
--- a/lib/c32width.c
+++ b/lib/c32width.c
@@ -58,7 +58,7 @@ c32width (char32_t wc)
   else
     return wcwidth (wc);
 
-#elif HAVE_WORKING_MBRTOC32             /* glibc, Android */
+#elif HAVE_WORKING_MBRTOC32 && HAVE_WORKING_C32RTOMB /* glibc, Android */
   /* mbrtoc32() is essentially defined by the system libc.  */
 
 # if _GL_WCHAR_T_IS_UCS4
diff --git a/lib/mbrtoc32.c b/lib/mbrtoc32.c
index d97912876c..771c857d7d 100644
--- a/lib/mbrtoc32.c
+++ b/lib/mbrtoc32.c
@@ -117,7 +117,7 @@ mbrtoc32 (char32_t *pwc, const char *s, size_t n, mbstate_t 
*ps)
   if (ps == NULL)
     ps = &internal_state;
 
-# if HAVE_WORKING_MBRTOC32 && !MBRTOC32_MULTIBYTE_LOCALE_BUG
+# if HAVE_WORKING_MBRTOC32 && HAVE_WORKING_C32RTOMB && 
!MBRTOC32_MULTIBYTE_LOCALE_BUG
   /* mbrtoc32() may produce different values for wc than mbrtowc().  Therefore
      use mbrtoc32().  */
 
diff --git a/lib/mbsnrtoc32s.c b/lib/mbsnrtoc32s.c
index 47aa70ead2..a4d13042ff 100644
--- a/lib/mbsnrtoc32s.c
+++ b/lib/mbsnrtoc32s.c
@@ -23,7 +23,7 @@
 
 #include <wchar.h>
 
-#if (HAVE_WORKING_MBRTOC32 && !_GL_WCHAR_T_IS_UCS4) || (GL_CHAR32_T_IS_UNICODE 
&& GL_CHAR32_T_VS_WCHAR_T_NEEDS_CONVERSION) || _GL_SMALL_WCHAR_T
+#if (HAVE_WORKING_MBRTOC32 && HAVE_WORKING_C32RTOMB && !_GL_WCHAR_T_IS_UCS4) 
|| (GL_CHAR32_T_IS_UNICODE && GL_CHAR32_T_VS_WCHAR_T_NEEDS_CONVERSION) || 
_GL_SMALL_WCHAR_T
 /* The char32_t encoding of a multibyte character may be different than its
    wchar_t encoding, or char32_t is wider than wchar_t.  */
 
diff --git a/lib/mbsrtoc32s.c b/lib/mbsrtoc32s.c
index 896dc51207..e68b5e4f8f 100644
--- a/lib/mbsrtoc32s.c
+++ b/lib/mbsrtoc32s.c
@@ -23,7 +23,7 @@
 
 #include <wchar.h>
 
-#if (HAVE_WORKING_MBRTOC32 && !_GL_WCHAR_T_IS_UCS4) || (GL_CHAR32_T_IS_UNICODE 
&& GL_CHAR32_T_VS_WCHAR_T_NEEDS_CONVERSION) || _GL_SMALL_WCHAR_T
+#if (HAVE_WORKING_MBRTOC32 && HAVE_WORKING_C32RTOMB && !_GL_WCHAR_T_IS_UCS4) 
|| (GL_CHAR32_T_IS_UNICODE && GL_CHAR32_T_VS_WCHAR_T_NEEDS_CONVERSION) || 
_GL_SMALL_WCHAR_T
 /* The char32_t encoding of a multibyte character may be different than its
    wchar_t encoding, or char32_t is wider than wchar_t.  */
 
diff --git a/m4/c32rtomb.m4 b/m4/c32rtomb.m4
index cb8ab0abbd..cf7ff69dae 100644
--- a/m4/c32rtomb.m4
+++ b/m4/c32rtomb.m4
@@ -1,5 +1,5 @@
 # c32rtomb.m4
-# serial 7
+# serial 8
 dnl Copyright (C) 2020-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,
@@ -11,7 +11,61 @@ AC_DEFUN([gl_FUNC_C32RTOMB]
   AC_REQUIRE([AC_CANONICAL_HOST])
 
   AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+  AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
 
+  AC_REQUIRE([gl_CHECK_FUNC_C32RTOMB])
+  if test $gl_cv_func_c32rtomb = no; then
+    HAVE_C32RTOMB=0
+  else
+    dnl When we override mbrtoc32, redefining the meaning of the char32_t
+    dnl values, we need to override c32rtomb as well, for consistency.
+    if test $HAVE_WORKING_MBRTOC32 = 0; then
+      REPLACE_C32RTOMB=1
+    fi
+    AC_CACHE_CHECK([whether c32rtomb return value is correct],
+      [gl_cv_func_c32rtomb_retval],
+      [
+        dnl Initial guess, used when cross-compiling.
+changequote(,)dnl
+        case "$host_os" in
+          # Guess no on AIX.
+          aix*) gl_cv_func_c32rtomb_retval="guessing no" ;;
+          # Guess yes otherwise.
+          *)    gl_cv_func_c32rtomb_retval="guessing yes" ;;
+        esac
+changequote([,])dnl
+        AC_RUN_IFELSE(
+          [AC_LANG_SOURCE([[
+#include <stddef.h>
+#ifdef __HAIKU__
+ #include <stdint.h>
+#endif
+#include <uchar.h>
+int main ()
+{
+  int result = 0;
+  if (c32rtomb (NULL, 0, NULL) != 1)
+    result |= 1;
+  return result;
+}]])],
+          [gl_cv_func_c32rtomb_retval=yes],
+          [gl_cv_func_c32rtomb_retval=no],
+          [:])
+      ])
+    case "$gl_cv_func_c32rtomb_retval" in
+      *yes) ;;
+      *) AC_DEFINE([C32RTOMB_RETVAL_BUG], [1],
+           [Define if the c32rtomb function has an incorrect return value.])
+         REPLACE_C32RTOMB=1 ;;
+    esac
+    if test $HAVE_WORKING_C32RTOMB = 0; then
+      REPLACE_C32RTOMB=1
+    fi
+  fi
+])
+
+AC_DEFUN([gl_CHECK_FUNC_C32RTOMB],
+[
   dnl Cf. gl_CHECK_FUNCS_ANDROID
   AC_CHECK_DECL([c32rtomb], , ,
     [[#ifdef __HAIKU__
@@ -41,29 +95,49 @@ AC_DEFUN([gl_FUNC_C32RTOMB]
   else
     gl_cv_func_c32rtomb=no
   fi
-  if test $gl_cv_func_c32rtomb = no; then
-    HAVE_C32RTOMB=0
+])
+
+dnl Test whether c32rtomb works not worse than wcrtomb.
+dnl Result is HAVE_WORKING_C32RTOMB.
+
+AC_DEFUN([gl_C32RTOMB_SANITYCHECK],
+[
+  AC_REQUIRE([AC_PROG_CC])
+  AC_REQUIRE([gl_TYPE_CHAR32_T])
+  AC_REQUIRE([gl_CHECK_FUNC_C32RTOMB])
+  AC_REQUIRE([gt_LOCALE_ZH_CN])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  if test $GNULIBHEADERS_OVERRIDE_CHAR32_T = 1 || test $gl_cv_func_c32rtomb = 
no; then
+    HAVE_WORKING_C32RTOMB=0
   else
-    dnl When we override mbrtoc32, redefining the meaning of the char32_t
-    dnl values, we need to override c32rtomb as well, for consistency.
-    if test $HAVE_WORKING_MBRTOC32 = 0; then
-      REPLACE_C32RTOMB=1
-    fi
-    AC_CACHE_CHECK([whether c32rtomb return value is correct],
-      [gl_cv_func_c32rtomb_retval],
+    AC_CACHE_CHECK([whether c32rtomb works as well as wcrtomb],
+      [gl_cv_func_c32rtomb_sanitycheck],
       [
-        dnl Initial guess, used when cross-compiling.
+        dnl Initial guess, used when cross-compiling or when no suitable locale
+        dnl is present.
 changequote(,)dnl
         case "$host_os" in
-          # Guess no on AIX.
-          aix*) gl_cv_func_c32rtomb_retval="guessing no" ;;
+          # Guess no on Solaris derivatives.
+          solaris*)
+            if test -f /etc/release && grep 'Oracle Solaris' /etc/release 
>/dev/null; then
+              gl_cv_func_c32rtomb_sanitycheck="guessing yes"
+            else
+              gl_cv_func_c32rtomb_sanitycheck="guessing no"
+            fi
+            ;;
           # Guess yes otherwise.
-          *)    gl_cv_func_c32rtomb_retval="guessing yes" ;;
+          *)
+            gl_cv_func_c32rtomb_sanitycheck="guessing yes"
+            ;;
         esac
 changequote([,])dnl
-        AC_RUN_IFELSE(
-          [AC_LANG_SOURCE([[
-#include <stddef.h>
+        if test $LOCALE_ZH_CN != none; then
+          AC_RUN_IFELSE(
+            [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
 #ifdef __HAIKU__
  #include <stdint.h>
 #endif
@@ -71,19 +145,42 @@ AC_DEFUN([gl_FUNC_C32RTOMB]
 int main ()
 {
   int result = 0;
-  if (c32rtomb (NULL, 0, NULL) != 1)
-    result |= 1;
+  /* This fails on Solaris 11 OmniOS:
+     c32rtomb returns (size_t)-1.
+     wcrtomb returns 4 (correct).  */
+  if (strcmp ("$LOCALE_ZH_CN", "none") != 0
+      && setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+    {
+      mbstate_t state;
+      wchar_t wc = (wchar_t) 0xBADFACE;
+      char buf[16];
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, "\201\060\211\070", 4, &state) == 4
+          && wcrtomb (buf, wc, NULL) == 4
+          && memcmp (buf, "\201\060\211\070", 4) == 0)
+        {
+          char32_t c32 = (wchar_t) 0xBADFACE;
+          memset (&state, '\0', sizeof (mbstate_t));
+          if (mbrtoc32 (&c32, "\201\060\211\070", 4, &state) == 4
+              && c32rtomb (buf, c32, NULL) != 4)
+            result |= 1;
+        }
+    }
   return result;
 }]])],
-          [gl_cv_func_c32rtomb_retval=yes],
-          [gl_cv_func_c32rtomb_retval=no],
-          [:])
+            [gl_cv_func_c32rtomb_sanitycheck=yes],
+            [gl_cv_func_c32rtomb_sanitycheck=no],
+            [:])
+        fi
       ])
-    case "$gl_cv_func_c32rtomb_retval" in
-      *yes) ;;
-      *) AC_DEFINE([C32RTOMB_RETVAL_BUG], [1],
-           [Define if the c32rtomb function has an incorrect return value.])
-         REPLACE_C32RTOMB=1 ;;
+    case "$gl_cv_func_c32rtomb_sanitycheck" in
+      *yes)
+        HAVE_WORKING_C32RTOMB=1
+        AC_DEFINE([HAVE_WORKING_C32RTOMB], [1],
+          [Define if the c32rtomb function basically works.])
+        ;;
+      *) HAVE_WORKING_C32RTOMB=0 ;;
     esac
   fi
+  AC_SUBST([HAVE_WORKING_C32RTOMB])
 ])
diff --git a/m4/mbrtoc32.m4 b/m4/mbrtoc32.m4
index 1f1d91cd72..8118ff8f29 100644
--- a/m4/mbrtoc32.m4
+++ b/m4/mbrtoc32.m4
@@ -1,5 +1,5 @@
 # mbrtoc32.m4
-# serial 19
+# serial 20
 dnl Copyright (C) 2014-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,
@@ -230,7 +230,7 @@ AC_DEFUN([gl_MBRTOC32_SANITYCHECK]
   AC_REQUIRE([gl_CHECK_FUNC_MBRTOC32])
   AC_REQUIRE([gt_LOCALE_FR])
   AC_REQUIRE([gt_LOCALE_ZH_CN])
-  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_REQUIRE([AC_CANONICAL_HOST])
   if test $GNULIBHEADERS_OVERRIDE_CHAR32_T = 1 || test $gl_cv_func_mbrtoc32 = 
no; then
     HAVE_WORKING_MBRTOC32=0
   else
@@ -320,5 +320,6 @@ AC_DEFUN([gl_MBRTOC32_SANITYCHECK]
 
 # Prerequisites of lib/mbrtoc32.c and lib/lc-charset-dispatch.c.
 AC_DEFUN([gl_PREREQ_MBRTOC32], [
+  AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
   :
 ])
diff --git a/modules/c32isalnum b/modules/c32isalnum
index f202a37cf0..4626d15373 100644
--- a/modules/c32isalnum
+++ b/modules/c32isalnum
@@ -5,6 +5,7 @@ Files:
 lib/c32isalnum.c
 lib/c32is-impl.h
 m4/mbrtoc32.m4
+m4/c32rtomb.m4
 m4/mbrtowc.m4
 m4/locale-fr.m4
 m4/locale-ja.m4
@@ -26,6 +27,7 @@ dnl Determine REPLACE_MBSTATE_T, from which 
GNULIB_defined_mbstate_t is
 dnl determined.  It describes how mbrtoc32 is implemented.
 AC_REQUIRE([gl_MBSTATE_T_BROKEN])
 AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
 gl_UCHAR_MODULE_INDICATOR([c32isalnum])
 
 Makefile.am:
diff --git a/modules/c32isalpha b/modules/c32isalpha
index 1fc1ee58de..8d2a33ebce 100644
--- a/modules/c32isalpha
+++ b/modules/c32isalpha
@@ -5,6 +5,7 @@ Files:
 lib/c32isalpha.c
 lib/c32is-impl.h
 m4/mbrtoc32.m4
+m4/c32rtomb.m4
 m4/mbrtowc.m4
 m4/locale-fr.m4
 m4/locale-ja.m4
@@ -26,6 +27,7 @@ dnl Determine REPLACE_MBSTATE_T, from which 
GNULIB_defined_mbstate_t is
 dnl determined.  It describes how mbrtoc32 is implemented.
 AC_REQUIRE([gl_MBSTATE_T_BROKEN])
 AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
 gl_UCHAR_MODULE_INDICATOR([c32isalpha])
 
 Makefile.am:
diff --git a/modules/c32isblank b/modules/c32isblank
index ad1e7c139f..08d9038790 100644
--- a/modules/c32isblank
+++ b/modules/c32isblank
@@ -5,6 +5,7 @@ Files:
 lib/c32isblank.c
 lib/c32is-impl.h
 m4/mbrtoc32.m4
+m4/c32rtomb.m4
 m4/mbrtowc.m4
 m4/locale-fr.m4
 m4/locale-ja.m4
@@ -27,6 +28,7 @@ dnl Determine REPLACE_MBSTATE_T, from which 
GNULIB_defined_mbstate_t is
 dnl determined.  It describes how mbrtoc32 is implemented.
 AC_REQUIRE([gl_MBSTATE_T_BROKEN])
 AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
 gl_UCHAR_MODULE_INDICATOR([c32isblank])
 
 Makefile.am:
diff --git a/modules/c32iscntrl b/modules/c32iscntrl
index 2d423795e9..b1a56eba04 100644
--- a/modules/c32iscntrl
+++ b/modules/c32iscntrl
@@ -5,6 +5,7 @@ Files:
 lib/c32iscntrl.c
 lib/c32is-impl.h
 m4/mbrtoc32.m4
+m4/c32rtomb.m4
 m4/mbrtowc.m4
 m4/locale-fr.m4
 m4/locale-ja.m4
@@ -26,6 +27,7 @@ dnl Determine REPLACE_MBSTATE_T, from which 
GNULIB_defined_mbstate_t is
 dnl determined.  It describes how mbrtoc32 is implemented.
 AC_REQUIRE([gl_MBSTATE_T_BROKEN])
 AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
 gl_UCHAR_MODULE_INDICATOR([c32iscntrl])
 
 Makefile.am:
diff --git a/modules/c32isdigit b/modules/c32isdigit
index 631f50f917..9f295b3ad1 100644
--- a/modules/c32isdigit
+++ b/modules/c32isdigit
@@ -5,6 +5,7 @@ Files:
 lib/c32isdigit.c
 lib/c32is-impl.h
 m4/mbrtoc32.m4
+m4/c32rtomb.m4
 m4/mbrtowc.m4
 m4/locale-fr.m4
 m4/locale-ja.m4
@@ -27,6 +28,7 @@ dnl Determine REPLACE_MBSTATE_T, from which 
GNULIB_defined_mbstate_t is
 dnl determined.  It describes how mbrtoc32 is implemented.
 AC_REQUIRE([gl_MBSTATE_T_BROKEN])
 AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
 gl_UCHAR_MODULE_INDICATOR([c32isdigit])
 
 Makefile.am:
diff --git a/modules/c32isgraph b/modules/c32isgraph
index 48b5e7b10a..b5a02b0405 100644
--- a/modules/c32isgraph
+++ b/modules/c32isgraph
@@ -5,6 +5,7 @@ Files:
 lib/c32isgraph.c
 lib/c32is-impl.h
 m4/mbrtoc32.m4
+m4/c32rtomb.m4
 m4/mbrtowc.m4
 m4/locale-fr.m4
 m4/locale-ja.m4
@@ -26,6 +27,7 @@ dnl Determine REPLACE_MBSTATE_T, from which 
GNULIB_defined_mbstate_t is
 dnl determined.  It describes how mbrtoc32 is implemented.
 AC_REQUIRE([gl_MBSTATE_T_BROKEN])
 AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
 gl_UCHAR_MODULE_INDICATOR([c32isgraph])
 
 Makefile.am:
diff --git a/modules/c32islower b/modules/c32islower
index 40563f6f0a..77f17a861f 100644
--- a/modules/c32islower
+++ b/modules/c32islower
@@ -5,6 +5,7 @@ Files:
 lib/c32islower.c
 lib/c32is-impl.h
 m4/mbrtoc32.m4
+m4/c32rtomb.m4
 m4/mbrtowc.m4
 m4/locale-fr.m4
 m4/locale-ja.m4
@@ -26,6 +27,7 @@ dnl Determine REPLACE_MBSTATE_T, from which 
GNULIB_defined_mbstate_t is
 dnl determined.  It describes how mbrtoc32 is implemented.
 AC_REQUIRE([gl_MBSTATE_T_BROKEN])
 AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
 gl_UCHAR_MODULE_INDICATOR([c32islower])
 
 Makefile.am:
diff --git a/modules/c32isprint b/modules/c32isprint
index 1fc5d22a65..10f74e6887 100644
--- a/modules/c32isprint
+++ b/modules/c32isprint
@@ -5,6 +5,7 @@ Files:
 lib/c32isprint.c
 lib/c32is-impl.h
 m4/mbrtoc32.m4
+m4/c32rtomb.m4
 m4/mbrtowc.m4
 m4/locale-fr.m4
 m4/locale-ja.m4
@@ -26,6 +27,7 @@ dnl Determine REPLACE_MBSTATE_T, from which 
GNULIB_defined_mbstate_t is
 dnl determined.  It describes how mbrtoc32 is implemented.
 AC_REQUIRE([gl_MBSTATE_T_BROKEN])
 AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
 gl_UCHAR_MODULE_INDICATOR([c32isprint])
 
 Makefile.am:
diff --git a/modules/c32ispunct b/modules/c32ispunct
index ff9ee40825..7a8af0e392 100644
--- a/modules/c32ispunct
+++ b/modules/c32ispunct
@@ -6,6 +6,7 @@ Files:
 lib/c32ispunct.c
 lib/c32is-impl.h
 m4/mbrtoc32.m4
+m4/c32rtomb.m4
 m4/mbrtowc.m4
 m4/locale-fr.m4
 m4/locale-ja.m4
@@ -28,6 +29,7 @@ dnl Determine REPLACE_MBSTATE_T, from which 
GNULIB_defined_mbstate_t is
 dnl determined.  It describes how mbrtoc32 is implemented.
 AC_REQUIRE([gl_MBSTATE_T_BROKEN])
 AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
 gl_UCHAR_MODULE_INDICATOR([c32ispunct])
 
 Makefile.am:
diff --git a/modules/c32isspace b/modules/c32isspace
index 1b519e42ce..28befaacc5 100644
--- a/modules/c32isspace
+++ b/modules/c32isspace
@@ -5,6 +5,7 @@ Files:
 lib/c32isspace.c
 lib/c32is-impl.h
 m4/mbrtoc32.m4
+m4/c32rtomb.m4
 m4/mbrtowc.m4
 m4/locale-fr.m4
 m4/locale-ja.m4
@@ -26,6 +27,7 @@ dnl Determine REPLACE_MBSTATE_T, from which 
GNULIB_defined_mbstate_t is
 dnl determined.  It describes how mbrtoc32 is implemented.
 AC_REQUIRE([gl_MBSTATE_T_BROKEN])
 AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
 gl_UCHAR_MODULE_INDICATOR([c32isspace])
 
 Makefile.am:
diff --git a/modules/c32isupper b/modules/c32isupper
index 08838dcecf..75cd04327f 100644
--- a/modules/c32isupper
+++ b/modules/c32isupper
@@ -5,6 +5,7 @@ Files:
 lib/c32isupper.c
 lib/c32is-impl.h
 m4/mbrtoc32.m4
+m4/c32rtomb.m4
 m4/mbrtowc.m4
 m4/locale-fr.m4
 m4/locale-ja.m4
@@ -26,6 +27,7 @@ dnl Determine REPLACE_MBSTATE_T, from which 
GNULIB_defined_mbstate_t is
 dnl determined.  It describes how mbrtoc32 is implemented.
 AC_REQUIRE([gl_MBSTATE_T_BROKEN])
 AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
 gl_UCHAR_MODULE_INDICATOR([c32isupper])
 
 Makefile.am:
diff --git a/modules/c32isxdigit b/modules/c32isxdigit
index e145ce36ce..9447744bb7 100644
--- a/modules/c32isxdigit
+++ b/modules/c32isxdigit
@@ -6,6 +6,7 @@ Files:
 lib/c32isxdigit.c
 lib/c32is-impl.h
 m4/mbrtoc32.m4
+m4/c32rtomb.m4
 m4/mbrtowc.m4
 m4/locale-fr.m4
 m4/locale-ja.m4
@@ -28,6 +29,7 @@ dnl Determine REPLACE_MBSTATE_T, from which 
GNULIB_defined_mbstate_t is
 dnl determined.  It describes how mbrtoc32 is implemented.
 AC_REQUIRE([gl_MBSTATE_T_BROKEN])
 AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
 gl_UCHAR_MODULE_INDICATOR([c32isxdigit])
 
 Makefile.am:
diff --git a/modules/c32tob b/modules/c32tob
index 11717a78f1..9e8c0a2869 100644
--- a/modules/c32tob
+++ b/modules/c32tob
@@ -4,6 +4,7 @@ c32tob() function: convert 32-bit wide character to unibyte 
character.
 Files:
 lib/c32tob.c
 m4/mbrtoc32.m4
+m4/c32rtomb.m4
 m4/locale-fr.m4
 m4/locale-zh.m4
 m4/codeset.m4
@@ -16,6 +17,7 @@ wctob
 
 configure.ac:
 AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
 gl_UCHAR_MODULE_INDICATOR([c32tob])
 
 Makefile.am:
diff --git a/modules/c32tolower b/modules/c32tolower
index 25579f5455..e4140f34a8 100644
--- a/modules/c32tolower
+++ b/modules/c32tolower
@@ -5,6 +5,7 @@ Files:
 lib/c32tolower.c
 lib/c32to-impl.h
 m4/mbrtoc32.m4
+m4/c32rtomb.m4
 m4/mbrtowc.m4
 m4/locale-fr.m4
 m4/locale-ja.m4
@@ -26,6 +27,7 @@ dnl Determine REPLACE_MBSTATE_T, from which 
GNULIB_defined_mbstate_t is
 dnl determined.  It describes how mbrtoc32 is implemented.
 AC_REQUIRE([gl_MBSTATE_T_BROKEN])
 AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
 gl_UCHAR_MODULE_INDICATOR([c32tolower])
 
 Makefile.am:
diff --git a/modules/c32toupper b/modules/c32toupper
index 792df3a096..16c7a0c7ae 100644
--- a/modules/c32toupper
+++ b/modules/c32toupper
@@ -5,6 +5,7 @@ Files:
 lib/c32toupper.c
 lib/c32to-impl.h
 m4/mbrtoc32.m4
+m4/c32rtomb.m4
 m4/mbrtowc.m4
 m4/locale-fr.m4
 m4/locale-ja.m4
@@ -26,6 +27,7 @@ dnl Determine REPLACE_MBSTATE_T, from which 
GNULIB_defined_mbstate_t is
 dnl determined.  It describes how mbrtoc32 is implemented.
 AC_REQUIRE([gl_MBSTATE_T_BROKEN])
 AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
 gl_UCHAR_MODULE_INDICATOR([c32toupper])
 
 Makefile.am:
diff --git a/modules/c32width b/modules/c32width
index aeee6856e5..1db9002bb4 100644
--- a/modules/c32width
+++ b/modules/c32width
@@ -5,6 +5,7 @@ a 32-bit wide character.
 Files:
 lib/c32width.c
 m4/mbrtoc32.m4
+m4/c32rtomb.m4
 m4/mbrtowc.m4
 m4/locale-fr.m4
 m4/locale-ja.m4
@@ -23,6 +24,7 @@ dnl Determine REPLACE_MBSTATE_T, from which 
GNULIB_defined_mbstate_t is
 dnl determined.  It describes how mbrtoc32 is implemented.
 AC_REQUIRE([gl_MBSTATE_T_BROKEN])
 AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+AC_REQUIRE([gl_C32RTOMB_SANITYCHECK])
 gl_UCHAR_MODULE_INDICATOR([c32width])
 
 Makefile.am:
diff --git a/modules/mbrtoc32 b/modules/mbrtoc32
index 7315fe1505..463756d08b 100644
--- a/modules/mbrtoc32
+++ b/modules/mbrtoc32
@@ -11,6 +11,7 @@ lib/mbtowc-lock.h
 lib/mbtowc-lock.c
 lib/windows-initguard.h
 m4/mbrtoc32.m4
+m4/c32rtomb.m4
 m4/locale-fr.m4
 m4/locale-zh.m4
 m4/codeset.m4






reply via email to

[Prev in Thread] Current Thread [Next in Thread]