This function is declared in stdio.h but symbol is missing in UCRT import
libraries.

This issue was reported at:
https://github.com/msys2/MINGW-packages/pull/22697#issuecomment-2541206219
---
 mingw-w64-crt/Makefile.am             |  1 +
 mingw-w64-crt/stdio/ucrt_ms_fprintf.c | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)
 create mode 100644 mingw-w64-crt/stdio/ucrt_ms_fprintf.c

diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index 6c08b9388030..5f5655b3b96b 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -395,6 +395,7 @@ src_ucrtbase=\
   misc/ucrt-access.c \
   stdio/ucrt_fprintf.c \
   stdio/ucrt_fscanf.c \
+  stdio/ucrt_ms_fprintf.c \
   stdio/ucrt_ms_fwprintf.c \
   stdio/ucrt_fwprintf.c \
   stdio/ucrt_printf.c \
diff --git a/mingw-w64-crt/stdio/ucrt_ms_fprintf.c 
b/mingw-w64-crt/stdio/ucrt_ms_fprintf.c
new file mode 100644
index 000000000000..15588bcae709
--- /dev/null
+++ b/mingw-w64-crt/stdio/ucrt_ms_fprintf.c
@@ -0,0 +1,22 @@
+/**
+ * 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.
+ */
+
+#undef __MSVCRT_VERSION__
+#define _UCRT
+
+#include <stdio.h>
+#include <stdarg.h>
+
+int __cdecl __ms_fprintf(FILE * restrict file, const char * restrict format, 
...)
+{
+  va_list ap;
+  int ret;
+  va_start(ap, format);
+  ret = __stdio_common_vfprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, file, 
format, NULL, ap);
+  va_end(ap);
+  return ret;
+}
+int __cdecl (*__MINGW_IMP_SYMBOL(__ms_fprintf))(FILE * restrict, const char * 
restrict, ...) = __ms_fprintf;
-- 
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