crt: crtdll and msvcrt10: Add support for C95 fputws() function

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ö <martin@martin.st>
This commit is contained in:
Pali Rohár 2024-11-15 18:00:02 +01:00 committed by Martin Storsjö
parent 0cd510287b
commit 6fe7c272cf
2 changed files with 13 additions and 0 deletions

View File

@ -709,6 +709,7 @@ src_pre_msvcrt20=\
misc/__p__winver.c \ misc/__p__winver.c \
misc/__timezone.c \ misc/__timezone.c \
misc/__tzname.c \ misc/__tzname.c \
stdio/fputws.c \
stdio/iob_func.c stdio/iob_func.c
src_pre_msvcrt40=\ src_pre_msvcrt40=\

View File

@ -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 <stdio.h>
int __cdecl fputws(const wchar_t * __restrict__ _Str, FILE * __restrict__ _File)
{
return __ms_fwprintf(_File, L"%ls", _Str);
}