summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2019-12-07 18:49:45 +0100
committerBruno Haible <bruno@clisp.org>2019-12-07 18:49:45 +0100
commitbf92de50a07679dbc5c48cffd9e17cd374d39ff2 (patch)
tree4770d50ab67de9939d305aa6b8857216f1f54adb
parentcd1dac96d3623f6390b632eb8498282300549dab (diff)
downloadgnulib-bf92de50a07679dbc5c48cffd9e17cd374d39ff2.tar.gz
gnulib-bf92de50a07679dbc5c48cffd9e17cd374d39ff2.tar.bz2
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.
-rw-r--r--ChangeLog7
-rw-r--r--lib/wchar.in.h7
2 files changed, 12 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 8507dcd013..bf4139f7ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
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.
* doc/posix-headers/monetary.texi: Mention the NetBSD bug.
diff --git a/lib/wchar.in.h b/lib/wchar.in.h
index 71b1efe9ca..af019e6c25 100644
--- a/lib/wchar.in.h
+++ b/lib/wchar.in.h
@@ -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

Return to:

Send suggestions and report system problems to the System administrator.