From: Bruno Haible Date: Sun, 9 Apr 2023 16:02:51 +0000 (+0200) Subject: mbrtoc32: Add comments. X-Git-Tag: v1.0~1481 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=70f1f0e64c1c1d722cb60560b76e4aef3f5d8d61;p=gnulib.git mbrtoc32: Add comments. * lib/mbrtoc32.c: Add comment regarding AIX. * m4/mbrtoc32.m4 (gl_FUNC_MBRTOC32): Add comment regarding GNULIB_defined_mbstate_t. --- diff --git a/ChangeLog b/ChangeLog index d13727e2eb..9a62ffa171 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2023-04-09 Bruno Haible + + mbrtoc32: Add comments. + * lib/mbrtoc32.c: Add comment regarding AIX. + * m4/mbrtoc32.m4 (gl_FUNC_MBRTOC32): Add comment regarding + GNULIB_defined_mbstate_t. + 2023-04-09 Bruno Haible doc: Mention a NetBSD bug. diff --git a/lib/mbrtoc32.c b/lib/mbrtoc32.c index bd90132086..2dca9e1e50 100644 --- a/lib/mbrtoc32.c +++ b/lib/mbrtoc32.c @@ -30,6 +30,13 @@ /* Implement mbrtoc32() on top of mbtowc() for the non-UTF-8 locales and directly for the UTF-8 locales. */ +/* Note: On AIX (64-bit) we can implement mbrtoc32 in two equivalent ways: + - in a way that parallels the override of mbrtowc; this is the code branch + here; + - in a way that invokes the overridden mbrtowc; this would be the #else + branch below. + They are equivalent. */ + # if defined _WIN32 && !defined __CYGWIN__ # define WIN32_LEAN_AND_MEAN /* avoid including junk */ diff --git a/m4/mbrtoc32.m4 b/m4/mbrtoc32.m4 index acbd7f537c..ed0234fbc0 100644 --- a/m4/mbrtoc32.m4 +++ b/m4/mbrtoc32.m4 @@ -1,4 +1,4 @@ -# mbrtoc32.m4 serial 12 +# mbrtoc32.m4 serial 13 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, @@ -9,6 +9,9 @@ AC_DEFUN([gl_FUNC_MBRTOC32], AC_REQUIRE([gl_UCHAR_H_DEFAULTS]) AC_REQUIRE([AC_TYPE_MBSTATE_T]) + dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is + dnl determined. It describes how our overridden mbrtowc is implemented. + dnl We then implement mbrtoc32 accordingly. gl_MBSTATE_T_BROKEN AC_REQUIRE([gl_TYPE_CHAR32_T])