]> 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>
Fri, 21 Apr 2023 02:02:28 +0000 (04:02 +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 c6d4c360bef9e21c8b342cfa26768321fd3a52dd..fa513fa2dc25c3b02f8f0bb12e3946cae2d541db 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-08  Bruno Haible  <bruno@clisp.org>
 
        Avoid Autoconf "was expanded before it was required" warning.
index 6d09fe6db4baf826e76e66722f4822b73719360b..85c4d04997888d6b5488dcb800272887e9190bb1 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert multibyte character to 32-bit wide character.
-   Copyright (C) 2020-2022 Free Software Foundation, Inc.
+   Copyright (C) 2020-2023 Free Software Foundation, Inc.
 
    This file is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as
 /* 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 91c8c556850e16a92db141f7ccba79eda1519130..a193c97c969c152f3ed3c8c0ec223b6f8bfa78cd 100644 (file)
@@ -1,5 +1,5 @@
-# mbrtoc32.m4 serial 9
-dnl Copyright (C) 2014-2022 Free Software Foundation, Inc.
+# mbrtoc32.m4 serial 9.1
+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,
 dnl with or without modifications, as long as this notice is preserved.
@@ -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])