From bf92de50a07679dbc5c48cffd9e17cd374d39ff2 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 7 Dec 2019 18:49:45 +0100 Subject: [PATCH] Fix compilation errors in C++ mode on AIX with xlclang++. Reported by Christian Biesinger in . * lib/wchar.in.h (mbstate_t): Don't override on AIX. --- ChangeLog | 7 +++++++ lib/wchar.in.h | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8507dcd013..bf4139f7ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2019-12-07 Bruno Haible + + Fix compilation errors in C++ mode on AIX with xlclang++. + Reported by Christian Biesinger in + . + * lib/wchar.in.h (mbstate_t): Don't override on AIX. + 2019-12-07 Bruno Haible Document compilation error in C++ mode on NetBSD 8.0. 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 -- 2.39.5