summaryrefslogtreecommitdiff
path: root/gnulib-m4/mbrtowc.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gnulib-m4/mbrtowc.m4')
-rw-r--r--gnulib-m4/mbrtowc.m474
1 files changed, 8 insertions, 66 deletions
diff --git a/gnulib-m4/mbrtowc.m4 b/gnulib-m4/mbrtowc.m4
index ad7a7c73..4ed9510f 100644
--- a/gnulib-m4/mbrtowc.m4
+++ b/gnulib-m4/mbrtowc.m4
@@ -1,10 +1,11 @@
# mbrtowc.m4
-# serial 46
-dnl Copyright (C) 2001-2002, 2004-2005, 2008-2024 Free Software Foundation,
+# 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
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+dnl This file is offered as-is, without any warranty.
AC_DEFUN([gl_FUNC_MBRTOWC],
[
@@ -32,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
@@ -45,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],
@@ -169,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
@@ -345,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).
@@ -715,7 +657,7 @@ AC_DEFUN([gl_MBRTOWC_EMPTY_INPUT],
dnl Test whether mbrtowc reports encoding errors in the C locale.
dnl Although POSIX was never intended to allow this, the GNU C Library
dnl and other implementations do it. See:
-dnl https://sourceware.org/bugzilla/show_bug.cgi?id=19932
+dnl https://sourceware.org/PR19932
dnl POSIX has now clarified it:
dnl <https://pubs.opengroup.org/onlinepubs/9699919799/functions/mbrtowc.html>
dnl says: "In the POSIX locale an [EILSEQ] error cannot occur since all byte