]> Savannah Git Hosting - gnulib.git/commitdiff
mbrtoc32: Add comments.
authorBruno Haible <bruno@clisp.org>
Sun, 9 Apr 2023 16:02:51 +0000 (18:02 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 9 Apr 2023 21:46:48 +0000 (23:46 +0200)
* lib/mbrtoc32.c: Add comment regarding AIX.
* m4/mbrtoc32.m4 (gl_FUNC_MBRTOC32): Add comment regarding
GNULIB_defined_mbstate_t.

ChangeLog
lib/mbrtoc32.c
m4/mbrtoc32.m4

index d13727e2eb580ff56d17b5dee8ecd28946a30f77..9a62ffa171b6c98ddf159c84189cf7ad09fe3dcf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-04-09  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        doc: Mention a NetBSD bug.
index bd901320867afb368f489ea2f6a3260ddf9dda92..2dca9e1e5075114644f6d5ea6bf3e41fd80a2435 100644 (file)
 /* 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 */
index acbd7f537cd8bf22e672874ab9f9a9c4e8b7cb95..ed0234fbc0174db31c6dbf3547e1f6389dbcb195 100644 (file)
@@ -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])