]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
mbrtowc: Remove support for OSF/1.
authorBruno Haible <bruno@clisp.org>
Tue, 9 Sep 2025 10:43:00 +0000 (12:43 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 9 Sep 2025 10:43:00 +0000 (12:43 +0200)
* m4/mbrtowc.m4 (gl_MBRTOWC_NULL_ARG2): Remove macro.
(gl_FUNC_MBRTOWC): Don't invoke it. Don't define MBRTOWC_NULL_ARG2_BUG.
(gl_MBRTOWC_INCOMPLETE_STATE): Remove cross-compilation guess for OSF/1.
* lib/mbrtowc.c (rpl_mbrtowc): Ignore MBRTOWC_NULL_ARG2_BUG.

ChangeLog
lib/mbrtowc.c
m4/mbrtowc.m4

index 8b887a9329dca25fa61615ae2e98f40fbf7aad7d..0d5202e3f18f0eddb3a0b165892afeaaa5e7f3ee 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2025-09-09  Bruno Haible  <bruno@clisp.org>
 
+       mbrtowc: Remove support for OSF/1.
+       * m4/mbrtowc.m4 (gl_MBRTOWC_NULL_ARG2): Remove macro.
+       (gl_FUNC_MBRTOWC): Don't invoke it. Don't define MBRTOWC_NULL_ARG2_BUG.
+       (gl_MBRTOWC_INCOMPLETE_STATE): Remove cross-compilation guess for OSF/1.
+       * lib/mbrtowc.c (rpl_mbrtowc): Ignore MBRTOWC_NULL_ARG2_BUG.
+
        mbrlen: Remove support for OSF/1.
        * m4/mbrlen.m4 (gl_MBRLEN_INCOMPLETE_STATE): Remove cross-compilation
        guess for OSF/1.
index 6f0aa129b99faa0bdd7ee68198d626dcf1e21601..3043204929d0d0690f0e3946c59d8e5d7fb1b6fa 100644 (file)
@@ -84,7 +84,7 @@ rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
   size_t ret;
   wchar_t wc;
 
-# if MBRTOWC_NULL_ARG2_BUG || MBRTOWC_RETVAL_BUG || MBRTOWC_EMPTY_INPUT_BUG
+# if MBRTOWC_RETVAL_BUG || MBRTOWC_EMPTY_INPUT_BUG
   if (s == NULL)
     {
       pwc = NULL;
index 364295fe97424e5a428aae18d06e0c900aeb228c..4ed9510fd2f8b3166ec20032410fc88a6feb8558 100644 (file)
@@ -1,5 +1,5 @@
 # mbrtowc.m4
-# serial 46
+# serial 47
 dnl Copyright (C) 2001-2002, 2004-2005, 2008-2025 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
@@ -33,7 +33,6 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
       REPLACE_MBRTOWC=1
     else
       gl_MBRTOWC_NULL_ARG1
-      gl_MBRTOWC_NULL_ARG2
       gl_MBRTOWC_RETVAL
       gl_MBRTOWC_NUL_RETVAL
       gl_MBRTOWC_STORES_INCOMPLETE
@@ -46,13 +45,6 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
            REPLACE_MBRTOWC=1
            ;;
       esac
-      case "$gl_cv_func_mbrtowc_null_arg2" in
-        *yes) ;;
-        *) AC_DEFINE([MBRTOWC_NULL_ARG2_BUG], [1],
-             [Define if the mbrtowc function has the NULL string argument bug.])
-           REPLACE_MBRTOWC=1
-           ;;
-      esac
       case "$gl_cv_func_mbrtowc_retval" in
         *yes) ;;
         *) AC_DEFINE([MBRTOWC_RETVAL_BUG], [1],
@@ -170,10 +162,10 @@ AC_DEFUN([gl_MBRTOWC_INCOMPLETE_STATE],
       dnl is present.
 changequote(,)dnl
       case "$host_os" in
-                     # Guess no on AIX and OSF/1.
-        aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
-                     # Guess yes otherwise.
-        *)           gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
+              # Guess no on AIX.
+        aix*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
+              # Guess yes otherwise.
+        *)    gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
       esac
 changequote([,])dnl
       if test $LOCALE_JA != none; then
@@ -346,57 +338,6 @@ int main ()
     ])
 ])
 
-dnl Test whether mbrtowc supports a NULL string argument correctly.
-dnl Result is gl_cv_func_mbrtowc_null_arg2.
-
-AC_DEFUN([gl_MBRTOWC_NULL_ARG2],
-[
-  AC_REQUIRE([AC_PROG_CC])
-  AC_REQUIRE([gt_LOCALE_EN_UTF8])
-  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
-  AC_CACHE_CHECK([whether mbrtowc handles a NULL string argument],
-    [gl_cv_func_mbrtowc_null_arg2],
-    [
-      dnl Initial guess, used when cross-compiling or when no suitable locale
-      dnl is present.
-changequote(,)dnl
-      case "$host_os" in
-              # Guess no on OSF/1.
-        osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;;
-              # Guess yes otherwise.
-        *)    gl_cv_func_mbrtowc_null_arg2="guessing yes" ;;
-      esac
-changequote([,])dnl
-      if test "$LOCALE_EN_UTF8" != none; then
-        AC_RUN_IFELSE(
-          [AC_LANG_SOURCE([[
-#include <locale.h>
-#include <string.h>
-#include <wchar.h>
-int main ()
-{
-  if (setlocale (LC_ALL, "$LOCALE_EN_UTF8") != NULL)
-    {
-      mbstate_t state;
-      wchar_t wc;
-      int ret;
-
-      memset (&state, '\0', sizeof (mbstate_t));
-      wc = (wchar_t) 0xBADFACE;
-      mbrtowc (&wc, NULL, 5, &state);
-      /* Check that wc was not modified.  */
-      if (wc != (wchar_t) 0xBADFACE)
-        return 2;
-    }
-  return 0;
-}]])],
-          [gl_cv_func_mbrtowc_null_arg2=yes],
-          [gl_cv_func_mbrtowc_null_arg2=no],
-          [:])
-      fi
-    ])
-])
-
 dnl Test whether mbrtowc, when parsing the end of a multibyte character,
 dnl correctly returns the number of bytes that were needed to complete the
 dnl character (not the total number of bytes of the multibyte character).