]> Savannah Git Hosting - gnulib.git/commitdiff
wchar: Fix wcrtomb prototype conflict in C++ mode on OpenBSD 6.0.
authorBruno Haible <bruno@clisp.org>
Sat, 28 Dec 2024 15:38:23 +0000 (16:38 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 31 Dec 2024 09:34:18 +0000 (10:34 +0100)
* lib/wchar.in.h (rpl_mbstate_t): Don't define on OpenBSD.

ChangeLog
lib/wchar.in.h

index 5744684268f0ad1baf9f797130c9db59b23e3bba..83a75d572a3065934644eef9032a8d636d77313a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-12-28  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        access, euidaccess tests: Avoid test failure in Cygwin 3.5.5.
index e5e92a1d1045b6ec88e2461c4dd3dc48d8b78641..c70dbcb5ac99ddd5c23fa19c9c1bbeec02766e6c 100644 (file)
@@ -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