Commit f61573ab authored by Bruno Haible's avatar Bruno Haible
Browse files

mbsinit: Fix compilation error in mingw-w64 7.0 with _UCRT defined.

Reported by Tom Kacvinsky <tom.kacvinsky@vector.com>
and Martin Storsjö <martin@martin.st>
in <https://savannah.gnu.org/bugs/?57406>.

* lib/mbsinit.c: Accommodate an MSVC-like mbstate_t definition with
mingw.
parent 29033183
2019-12-17 Bruno Haible <bruno@clisp.org>
mbsinit: Fix compilation error in mingw-w64 7.0 with _UCRT defined.
Reported by Tom Kacvinsky <tom.kacvinsky@vector.com>
and Martin Storsjö <martin@martin.st>
in <https://savannah.gnu.org/bugs/?57406>.
* lib/mbsinit.c: Accommodate an MSVC-like mbstate_t definition with
mingw.
2019-12-17 Bruno Haible <bruno@clisp.org>
 
glob: Avoid warning on mingw.
......@@ -56,13 +56,10 @@ mbsinit (const mbstate_t *ps)
{
# if defined _WIN32 && !defined __CYGWIN__
/* Native Windows. */
# ifdef __MINGW32__
/* On mingw, 'mbstate_t' is defined as 'int'. */
return ps == NULL || *ps == 0;
# else
/* MSVC defines 'mbstate_t' as an 8-byte struct; the first 4-bytes matter. */
/* MSVC defines 'mbstate_t' as an 8-byte struct; the first 4 bytes matter.
On mingw, 'mbstate_t' is sometimes defined as 'int', sometimes defined as
an 8-byte struct, of which the first 4 bytes matter. */
return ps == NULL || *(const unsigned int *)ps == 0;
# endif
# else
/* Minix, HP-UX 11.00, Solaris 2.6, Interix, ... */
/* Maybe this definition works, maybe not... */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment