From: Bruno Haible Date: Sat, 28 Dec 2024 15:38:23 +0000 (+0100) Subject: wchar: Fix wcrtomb prototype conflict in C++ mode on OpenBSD 6.0. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=ea27c8e4ed129d874defb5ab73976412e2f714df;p=gnulib.git wchar: Fix wcrtomb prototype conflict in C++ mode on OpenBSD 6.0. * lib/wchar.in.h (rpl_mbstate_t): Don't define on OpenBSD. --- diff --git a/ChangeLog b/ChangeLog index b39a4f48b0..bdf29d5e48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2024-12-28 Bruno Haible + + wchar: Fix wcrtomb prototype conflict in C++ mode on OpenBSD 6.0. + * lib/wchar.in.h (rpl_mbstate_t): Don't define on OpenBSD. + 2024-12-24 Bruno Haible access, euidaccess tests: Avoid test failure in Cygwin 3.5.5. diff --git a/lib/wchar.in.h b/lib/wchar.in.h index e5e92a1d10..c70dbcb5ac 100644 --- a/lib/wchar.in.h +++ b/lib/wchar.in.h @@ -198,11 +198,12 @@ 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. - On AIX and MSVC, mbrtowc needs to be overridden, but mbstate_t exists and is - large enough and overriding it would cause problems in C++ mode. */ + On AIX, MSVC, and OpenBSD 6.0, mbrtowc needs to be overridden, but + mbstate_t exists and is large enough and overriding it would cause problems + in C++ mode. */ #if !(((defined _WIN32 && !defined __CYGWIN__) || @HAVE_MBSINIT@) && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@ # if !GNULIB_defined_mbstate_t -# if !(defined _AIX || defined _MSC_VER) +# if !(defined _AIX || defined _MSC_VER || defined __OpenBSD__) typedef int rpl_mbstate_t; # undef mbstate_t # define mbstate_t rpl_mbstate_t