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.
---
 mingw-w64-crt/Makefile.am    |  2 ++
 mingw-w64-crt/stdio/fputws.c | 12 ++++++++++++
 2 files changed, 14 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 c694ad341133..69d86460a16e 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -751,6 +751,7 @@ src_crtdll=\
   stdio/_vscprintf.c \
   stdio/_vscwprintf.c \
   stdio/atoll.c \
+  stdio/fputws.c \
   stdio/fgetpos.c \
   stdio/fsetpos.c \
   stdio/fseeki64.c \
@@ -820,6 +821,7 @@ src_msvcrt10=\
   stdio/_vscprintf.c \
   stdio/_vscwprintf.c \
   stdio/atoll.c \
+  stdio/fputws.c \
   stdio/fgetpos.c \
   stdio/fsetpos.c \
   stdio/fseeki64.c \
diff --git a/mingw-w64-crt/stdio/fputws.c b/mingw-w64-crt/stdio/fputws.c
new file mode 100644
index 000000000000..7b9c867ec302
--- /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 <stdio.h>
+
+int __cdecl fputws(const wchar_t * __restrict__ _Str, FILE * __restrict__ 
_File)
+{
+    return __ms_fwprintf(_File, L"%ls", _Str);
+}
-- 
2.20.1



_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to