]> Savannah Git Hosting - gnulib.git/commitdiff
Fix compilation errors in C++ mode on AIX with xlclang++.
authorBruno Haible <bruno@clisp.org>
Sat, 7 Dec 2019 17:49:45 +0000 (18:49 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 7 Dec 2019 17:49:45 +0000 (18:49 +0100)
Reported by Christian Biesinger <cbiesinger@google.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2019-12/msg00009.html>.

* lib/wchar.in.h (mbstate_t): Don't override on AIX.

ChangeLog
lib/wchar.in.h

index 8507dcd01349b622cdda3e02d225a0f11e36af22..bf4139f7ba870e394c2dea1a15de0701f6b2a686 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2019-12-07  Bruno Haible  <bruno@clisp.org>
+
+       Fix compilation errors in C++ mode on AIX with xlclang++.
+       Reported by Christian Biesinger <cbiesinger@google.com> in
+       <https://lists.gnu.org/archive/html/bug-gnulib/2019-12/msg00009.html>.
+       * lib/wchar.in.h (mbstate_t): Don't override on AIX.
+
 2019-12-07  Bruno Haible  <bruno@clisp.org>
 
        Document compilation error in C++ mode on NetBSD 8.0.
index 71b1efe9ca84a122c54725e6dd916ef09e6a2d8d..af019e6c25a7c2f46e919a663af298fa2c6acce3 100644 (file)
@@ -137,8 +137,11 @@ typedef unsigned int rpl_wint_t;
 
 /* Override mbstate_t if it is too small.
    On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
-   implementing mbrtowc for encodings like UTF-8.  */
-#if !(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
+   implementing mbrtowc for encodings like UTF-8.
+   On AIX, mbrtowc needs to be overridden, but mbstate_t exists and is large
+   enough and overriding it would cause problems in C++ mode.  */
+#if (!(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@) \
+    && !defined _AIX
 # if !GNULIB_defined_mbstate_t
 typedef int rpl_mbstate_t;
 #  undef mbstate_t