From 6fe7c272cfbc4f10f6d7321f727ade92c62271e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= Date: Fri, 15 Nov 2024 18:00:02 +0100 Subject: [PATCH] crt: crtdll and msvcrt10: Add support for C95 fputws() function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All CRT libraries except crtdll.dll and msvcrt10.dll provide fputws function symbol. For these two libraries implement simple mingw-w64 emulation of fputws() via fwprintf() to have C95+ compatibility. Signed-off-by: Martin Storsjö --- mingw-w64-crt/Makefile.am | 1 + mingw-w64-crt/stdio/fputws.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 mingw-w64-crt/stdio/fputws.c diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am index 2b503ff19..88b319588 100644 --- a/mingw-w64-crt/Makefile.am +++ b/mingw-w64-crt/Makefile.am @@ -709,6 +709,7 @@ src_pre_msvcrt20=\ misc/__p__winver.c \ misc/__timezone.c \ misc/__tzname.c \ + stdio/fputws.c \ stdio/iob_func.c src_pre_msvcrt40=\ diff --git a/mingw-w64-crt/stdio/fputws.c b/mingw-w64-crt/stdio/fputws.c new file mode 100644 index 000000000..7b9c867ec --- /dev/null +++ b/mingw-w64-crt/stdio/fputws.c @@ -0,0 +1,12 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the mingw-w64 runtime package. + * No warranty is given; refer to the file DISCLAIMER.PD within this package. + */ + +#include + +int __cdecl fputws(const wchar_t * __restrict__ _Str, FILE * __restrict__ _File) +{ + return __ms_fwprintf(_File, L"%ls", _Str); +}