[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mbrtowc: don't replace mbstate_t on MSVC
From: |
Bruno Haible |
Subject: |
Re: mbrtowc: don't replace mbstate_t on MSVC |
Date: |
Thu, 02 Jan 2020 23:06:18 +0100 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-170-generic; KDE/5.18.0; x86_64; ; ) |
> mbrtowc: Don't replace mbstate_t on MSVC.
> * m4/mbrtowc.m4 (gl_MBSTATE_T_BROKEN): Require AC_CANONICAL_HOST. Ignore
> a missing mbsinit function on native Windows.
This patch was incomplete; to complete it, I committed this:
diff --git a/ChangeLog b/ChangeLog
index 143b5eb..a1866e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
mbrtowc: Don't replace mbstate_t on MSVC.
* m4/mbrtowc.m4 (gl_MBSTATE_T_BROKEN): Require AC_CANONICAL_HOST. Ignore
a missing mbsinit function on native Windows.
+ * lib/wchar.in.h (GNULIB_defined_mbstate_t): Likewise.
* m4/wcrtomb.m4 (gl_FUNC_WCRTOMB): Strengthen the test, to detect an
MSVC bug.
* doc/posix-functions/wcrtomb.texi: Mention the MSVC bug.
diff --git a/lib/wchar.in.h b/lib/wchar.in.h
index 834b3e8..74cd670 100644
--- a/lib/wchar.in.h
+++ b/lib/wchar.in.h
@@ -141,7 +141,7 @@ typedef unsigned int rpl_wint_t;
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. */
-#if !(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
+#if !(((defined _WIN32 && !defined __CYGWIN__) || @HAVE_MBSINIT@) &&
@HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
# if !GNULIB_defined_mbstate_t
# if !(defined _AIX || defined _MSC_VER)
typedef int rpl_mbstate_t;