]> Savannah Git Hosting - gnulib.git/commitdiff
mbrtowc: Don't replace mbstate_t on MSVC.
authorBruno Haible <bruno@clisp.org>
Thu, 2 Jan 2020 19:20:05 +0000 (20:20 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 2 Jan 2020 19:20:05 +0000 (20:20 +0100)
* lib/wchar.in.h (GNULIB_defined_mbstate_t): Ignore a missing mbsinit function
on native Windows.

ChangeLog
lib/wchar.in.h

index 143b5eb65e4a6458d4958f46ef6506409ea4b200..a1866e0b38fcb81dd7b24f28b50eeb915e48b9ca 100644 (file)
--- 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.
index 834b3e81f797360bb49152eafda6a3fcae707e8a..74cd67017f670f129ef78a3bf16bbafd25c12704 100644 (file)
@@ -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;