From 49c6f78c8b55f5d876ba499fdcd60a13661b49b7 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 21 Jan 2020 01:55:50 +0100 Subject: [PATCH] mbrtoc32: Add note about FreeBSD 12. * m4/mbrtoc32.m4 (gl_MBRTOC32_SANITYCHECK): Guess no also on FreeBSD. * doc/posix-functions/mbrtoc32.texi: Mention that FreeBSD 12 is also affected. --- ChangeLog | 7 +++++++ doc/posix-functions/mbrtoc32.texi | 2 +- m4/mbrtoc32.m4 | 18 +++++++++++------- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 29ee66869a..08f05f74c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2020-01-20 Bruno Haible + + mbrtoc32: Add note about FreeBSD 12. + * m4/mbrtoc32.m4 (gl_MBRTOC32_SANITYCHECK): Guess no also on FreeBSD. + * doc/posix-functions/mbrtoc32.texi: Mention that FreeBSD 12 is also + affected. + 2020-01-20 Bruno Haible unistr/u8-uctomb: Fix warning. diff --git a/doc/posix-functions/mbrtoc32.texi b/doc/posix-functions/mbrtoc32.texi index 9789bef130..3151a09fe2 100644 --- a/doc/posix-functions/mbrtoc32.texi +++ b/doc/posix-functions/mbrtoc32.texi @@ -20,7 +20,7 @@ glibc 2.19. @item This function does not recognize multibyte sequences that @code{mbrtowc} recognizes on some platforms: -Solaris 11.4, mingw, MSVC 14. +FreeBSD 12, Solaris 11.4, mingw, MSVC 14. @end itemize Portability problems not fixed by Gnulib: diff --git a/m4/mbrtoc32.m4 b/m4/mbrtoc32.m4 index 3dee9006e1..a5dc51a7a0 100644 --- a/m4/mbrtoc32.m4 +++ b/m4/mbrtoc32.m4 @@ -1,4 +1,4 @@ -# mbrtoc32.m4 serial 2 +# mbrtoc32.m4 serial 3 dnl Copyright (C) 2014-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -136,10 +136,14 @@ AC_DEFUN([gl_MBRTOC32_SANITYCHECK], dnl is present. changequote(,)dnl case "$host_os" in - # Guess no on Solaris, native Windows. - solaris* | mingw*) gl_cv_func_mbrtoc32_sanitycheck="guessing no" ;; - # Guess yes otherwise. - *) gl_cv_func_mbrtoc32_sanitycheck="guessing yes" ;; + # Guess no on FreeBSD, Solaris, native Windows. + freebsd* | solaris* | mingw*) + gl_cv_func_mbrtoc32_sanitycheck="guessing no" + ;; + # Guess yes otherwise. + *) + gl_cv_func_mbrtoc32_sanitycheck="guessing yes" + ;; esac changequote([,])dnl if test $LOCALE_FR != none || test $LOCALE_ZH_CN != none; then @@ -176,8 +180,8 @@ int main () result |= 1; } } - /* This fails on Solaris 11.4: - mbrtoc32 returns (size_t)-1. + /* This fails on FreeBSD 12 and Solaris 11.4: + mbrtoc32 returns (size_t)-2 or (size_t)-1. mbrtowc returns 4 (correct). */ if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) { -- 2.39.5