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.
# 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
REPLACE_MBRTOWC=1
else
gl_MBRTOWC_NULL_ARG1
- gl_MBRTOWC_NULL_ARG2
gl_MBRTOWC_RETVAL
gl_MBRTOWC_NUL_RETVAL
gl_MBRTOWC_STORES_INCOMPLETE
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],
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
])
])
-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).