]> git.ipfire.org Git - thirdparty/gnulib.git/commit
stdio-h: Work around fwrite bug in msvcrt.
authorBruno Haible <bruno@clisp.org>
Wed, 17 Sep 2025 06:38:14 +0000 (08:38 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 17 Sep 2025 09:30:19 +0000 (11:30 +0200)
commitdc8590b1ff4bebe52d4d08d3770b95298ae2575b
tree11f32b0946354e433a834649334800a907338dd7
parentc172e838f939f7c97daed1a80a7ec3479b4c43c6
stdio-h: Work around fwrite bug in msvcrt.

Reported by 松延 英樹 <maznobu@gmail.com> in
<https://github.com/mlocati/gettext-iconv-windows/issues/52>.

* lib/stdio.in.h (gl_consolesafe_fwrite): New declaration.
(fwrite): When msvcrt is in use, use gl_consolesafe_fwrite.
* lib/stdio-consolesafe.c: New file.
* lib/stdio-write.c (fwrite): When msvcrt is in use, use
gl_consolesafe_fwrite.
* modules/stdio.h (Files): Add lib/stdio-consolesafe.c.
(Depends-on): Add stdckdint-h.
(configure.ac): Define condition GL_COND_OBJ_STDIO_CONSOLESAFE.
(Makefile.am): Arrange to compile stdio-consolesafe.c.
* doc/posix-functions/fwrite.texi: Document the workaround.
ChangeLog
doc/posix-functions/fwrite.texi
lib/stdio-consolesafe.c [new file with mode: 0644]
lib/stdio-write.c
lib/stdio.in.h
modules/stdio-h