From: Bruno Haible Date: Wed, 28 Jun 2023 10:35:21 +0000 (+0200) Subject: mbrtoc32: Doc tweak. X-Git-Tag: v1.0~1176 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=489c6dc7baf1671c356a04473db7ebe160d3d7aa;p=gnulib.git mbrtoc32: Doc tweak. * doc/posix-functions/mbrtoc32.texi: Mention that mingw and Android have the empty input bug. * m4/mbrtoc32.m4 (gl_MBRTOC32_EMPTY_INPUT): Update cross-compilation guess. --- diff --git a/ChangeLog b/ChangeLog index e1d2c81d5f..44e3f9a6da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2023-06-28 Bruno Haible + + mbrtoc32: Doc tweak. + * doc/posix-functions/mbrtoc32.texi: Mention that mingw and Android have + the empty input bug. + * m4/mbrtoc32.m4 (gl_MBRTOC32_EMPTY_INPUT): Update cross-compilation + guess. + 2023-06-28 Bruno Haible mbrtowc: Doc tweak. diff --git a/doc/posix-functions/mbrtoc32.texi b/doc/posix-functions/mbrtoc32.texi index 91f88bf86f..8792a7b11b 100644 --- a/doc/posix-functions/mbrtoc32.texi +++ b/doc/posix-functions/mbrtoc32.texi @@ -16,13 +16,15 @@ glibc 2.35. @item This function returns 0 instead of @code{(size_t) -2} when the input is empty: -glibc 2.19, +glibc 2.19, mingw, Android 11, @c https://dev.haiku-os.org/ticket/18350 Haiku. @item This function does not recognize multibyte sequences that @code{mbrtowc} recognizes on some platforms: FreeBSD 13.0, Solaris 11.4, mingw, MSVC 14. +@c For MSVC this is because it assumes that the input is always UTF-8 encoded. +@c See https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/mbrtoc16-mbrtoc323 @end itemize Portability problems not fixed by Gnulib: diff --git a/m4/mbrtoc32.m4 b/m4/mbrtoc32.m4 index f5798db4a3..25196039bb 100644 --- a/m4/mbrtoc32.m4 +++ b/m4/mbrtoc32.m4 @@ -1,4 +1,4 @@ -# mbrtoc32.m4 serial 16 +# mbrtoc32.m4 serial 17 dnl Copyright (C) 2014-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -80,6 +80,8 @@ AC_DEFUN([gl_CHECK_FUNC_MBRTOC32], fi ]) +dnl Test whether mbrtoc32 returns the correct value on empty input. + AC_DEFUN([gl_MBRTOC32_EMPTY_INPUT], [ AC_REQUIRE([AC_PROG_CC]) @@ -103,9 +105,13 @@ AC_DEFUN([gl_MBRTOC32_EMPTY_INPUT], [gl_cv_func_mbrtoc32_empty_input=yes], [gl_cv_func_mbrtoc32_empty_input=no], [case "$host_os" in - # Guess no on glibc systems. - *-gnu* | gnu*) gl_cv_func_mbrtoc32_empty_input="guessing no" ;; - *) gl_cv_func_mbrtoc32_empty_input="guessing yes" ;; + # Guess no on glibc systems. + *-gnu* | gnu*) gl_cv_func_mbrtoc32_empty_input="guessing no" ;; + # Guess no on Android. + linux*-android*) gl_cv_func_mbrtoc32_empty_input="guessing no" ;; + # Guess no on native Windows. + mingw*) gl_cv_func_mbrtoc32_empty_input="guessing no" ;; + *) gl_cv_func_mbrtoc32_empty_input="guessing yes" ;; esac ]) ])