This allows configure checks that don't include headers to detect
them.
Signed-off-by: Martin Storsjö <[email protected]>
---
mingw-w64-crt/Makefile.am | 8 ++++-
mingw-w64-crt/stdio/ucrt_fscanf.c | 19 +++++++++++
mingw-w64-crt/stdio/ucrt_scanf.c | 19 +++++++++++
mingw-w64-crt/stdio/ucrt_sscanf.c | 20 ++++++++++++
mingw-w64-crt/stdio/ucrt_vfscanf.c | 14 ++++++++
mingw-w64-crt/stdio/ucrt_vscanf.c | 14 ++++++++
mingw-w64-crt/stdio/ucrt_vsscanf.c | 14 ++++++++
mingw-w64-headers/crt/stdio.h | 51 ++++--------------------------
8 files changed, 113 insertions(+), 46 deletions(-)
create mode 100644 mingw-w64-crt/stdio/ucrt_fscanf.c
create mode 100644 mingw-w64-crt/stdio/ucrt_scanf.c
create mode 100644 mingw-w64-crt/stdio/ucrt_sscanf.c
create mode 100644 mingw-w64-crt/stdio/ucrt_vfscanf.c
create mode 100644 mingw-w64-crt/stdio/ucrt_vscanf.c
create mode 100644 mingw-w64-crt/stdio/ucrt_vsscanf.c
diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index 5e7c0c746..05797000a 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -228,18 +228,24 @@ src_msvcrt=\
src_ucrtbase=\
crt/ucrtbase_compat.c \
stdio/ucrt_fprintf.c \
+ stdio/ucrt_fscanf.c \
stdio/ucrt_fwprintf.c \
stdio/ucrt_printf.c \
+ stdio/ucrt_scanf.c \
stdio/ucrt__snwprintf.c \
stdio/ucrt_snprintf.c \
stdio/ucrt_sprintf.c \
+ stdio/ucrt_sscanf.c \
stdio/ucrt__vscprintf.c \
stdio/ucrt__vsnprintf.c \
stdio/ucrt__vsnwprintf.c \
stdio/ucrt_vfprintf.c \
+ stdio/ucrt_vfscanf.c \
stdio/ucrt_vprintf.c \
+ stdio/ucrt_vscanf.c \
stdio/ucrt_vsnprintf.c \
- stdio/ucrt_vsprintf.c
+ stdio/ucrt_vsprintf.c \
+ stdio/ucrt_vsscanf.c
src_ucrtapp=\
crt/__C_specific_handler.c \
diff --git a/mingw-w64-crt/stdio/ucrt_fscanf.c
b/mingw-w64-crt/stdio/ucrt_fscanf.c
new file mode 100644
index 000000000..4b013f0a7
--- /dev/null
+++ b/mingw-w64-crt/stdio/ucrt_fscanf.c
@@ -0,0 +1,19 @@
+/**
+ * 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>
+
+int __cdecl fscanf(FILE * __restrict__ _File,const char * __restrict__
_Format,...) {
+ __builtin_va_list __ap;
+ int __ret;
+ __builtin_va_start(__ap, _Format);
+ __ret = __stdio_common_vfscanf(0, _File, _Format, NULL, __ap);
+ __builtin_va_end(__ap);
+ return __ret;
+}
+int __cdecl (*__MINGW_IMP_SYMBOL(fscanf))(FILE *__restrict__, const char
*__restrict__, ...) = fscanf;
diff --git a/mingw-w64-crt/stdio/ucrt_scanf.c b/mingw-w64-crt/stdio/ucrt_scanf.c
new file mode 100644
index 000000000..0e5035d15
--- /dev/null
+++ b/mingw-w64-crt/stdio/ucrt_scanf.c
@@ -0,0 +1,19 @@
+/**
+ * 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>
+
+int __cdecl scanf(const char * __restrict__ _Format,...) {
+ __builtin_va_list __ap;
+ int __ret;
+ __builtin_va_start(__ap, _Format);
+ __ret = __stdio_common_vfscanf(0, stdin, _Format, NULL, __ap);
+ __builtin_va_end(__ap);
+ return __ret;
+}
+int __cdecl (*__MINGW_IMP_SYMBOL(scanf))(const char *__restrict__, ...) =
scanf;
diff --git a/mingw-w64-crt/stdio/ucrt_sscanf.c
b/mingw-w64-crt/stdio/ucrt_sscanf.c
new file mode 100644
index 000000000..eb87379c4
--- /dev/null
+++ b/mingw-w64-crt/stdio/ucrt_sscanf.c
@@ -0,0 +1,20 @@
+/**
+ * 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>
+
+int __cdecl sscanf(const char * __restrict__ _Src,const char * __restrict__
_Format,...) {
+ __builtin_va_list __ap;
+ int __ret;
+ __builtin_va_start(__ap, _Format);
+ __ret = __stdio_common_vsscanf(0, _Src, (size_t)-1, _Format, NULL, __ap);
+ __builtin_va_end(__ap);
+ return __ret;
+}
+
+int __cdecl (*__MINGW_IMP_SYMBOL(sscanf))(const char *__restrict__, const char
*__restrict__, ...) = sscanf;
diff --git a/mingw-w64-crt/stdio/ucrt_vfscanf.c
b/mingw-w64-crt/stdio/ucrt_vfscanf.c
new file mode 100644
index 000000000..fe44cdf71
--- /dev/null
+++ b/mingw-w64-crt/stdio/ucrt_vfscanf.c
@@ -0,0 +1,14 @@
+/**
+ * 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>
+
+int __cdecl vfscanf (FILE *__stream, const char *__format, __builtin_va_list
__local_argv) {
+ return __stdio_common_vfscanf(0, __stream, __format, NULL, __local_argv);
+}
+int __cdecl (*__MINGW_IMP_SYMBOL(vfscanf))(FILE *, const char *,
__builtin_va_list) = vsscanf;
diff --git a/mingw-w64-crt/stdio/ucrt_vscanf.c
b/mingw-w64-crt/stdio/ucrt_vscanf.c
new file mode 100644
index 000000000..fc5ae1b1e
--- /dev/null
+++ b/mingw-w64-crt/stdio/ucrt_vscanf.c
@@ -0,0 +1,14 @@
+/**
+ * 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>
+
+int __cdecl vscanf(const char *__format, __builtin_va_list __local_argv) {
+ return __stdio_common_vfscanf(0, stdin, __format, NULL, __local_argv);
+}
+int __cdecl (*__MINGW_IMP_SYMBOL(vscanf))(const char *, __builtin_va_list) =
vscanf;
diff --git a/mingw-w64-crt/stdio/ucrt_vsscanf.c
b/mingw-w64-crt/stdio/ucrt_vsscanf.c
new file mode 100644
index 000000000..1fb76fcf1
--- /dev/null
+++ b/mingw-w64-crt/stdio/ucrt_vsscanf.c
@@ -0,0 +1,14 @@
+/**
+ * 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>
+
+int __cdecl vsscanf (const char * __restrict__ __source, const char *
__restrict__ __format, __builtin_va_list __local_argv) {
+ return __stdio_common_vsscanf(0, __source, (size_t)-1, __format, NULL,
__local_argv);
+}
+int __cdecl (*__MINGW_IMP_SYMBOL(vsscanf))(const char *__restrict, const char
*__restrict__, __builtin_va_list) = vsscanf;
diff --git a/mingw-w64-headers/crt/stdio.h b/mingw-w64-headers/crt/stdio.h
index fe15add03..33f5684e3 100644
--- a/mingw-w64-headers/crt/stdio.h
+++ b/mingw-w64-headers/crt/stdio.h
@@ -497,39 +497,12 @@ int vsnprintf (char *__stream, size_t __n, const char
*__format, __builtin_va_li
__attribute__((__format__ (__MINGW_PRINTF_FORMAT, 2, 0)))
__MINGW_ATTRIB_NONNULL(2)
int __cdecl vsprintf(char * __restrict__ _Dest,const char * __restrict__
_Format,va_list _Args) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
- __mingw_ovr
__attribute__((__format__ (__MINGW_SCANF_FORMAT, 2, 3)))
__MINGW_ATTRIB_NONNULL(2)
- int __cdecl fscanf(FILE * __restrict__ _File,const char * __restrict__
_Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN
- {
- __builtin_va_list __ap;
- int __ret;
- __builtin_va_start(__ap, _Format);
- __ret = __stdio_common_vfscanf(0, _File, _Format, NULL, __ap);
- __builtin_va_end(__ap);
- return __ret;
- }
- __mingw_ovr
+ int __cdecl fscanf(FILE * __restrict__ _File,const char * __restrict__
_Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
__attribute__((__format__ (__MINGW_SCANF_FORMAT, 1, 2)))
__MINGW_ATTRIB_NONNULL(1)
- int __cdecl scanf(const char * __restrict__ _Format,...)
__MINGW_ATTRIB_DEPRECATED_SEC_WARN
- {
- __builtin_va_list __ap;
- int __ret;
- __builtin_va_start(__ap, _Format);
- __ret = __stdio_common_vfscanf(0, stdin, _Format, NULL, __ap);
- __builtin_va_end(__ap);
- return __ret;
- }
- __mingw_ovr
+ int __cdecl scanf(const char * __restrict__ _Format,...)
__MINGW_ATTRIB_DEPRECATED_SEC_WARN;
__attribute__((__format__ (__MINGW_SCANF_FORMAT, 2, 3)))
__MINGW_ATTRIB_NONNULL(2)
- int __cdecl sscanf(const char * __restrict__ _Src,const char * __restrict__
_Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN
- {
- __builtin_va_list __ap;
- int __ret;
- __builtin_va_start(__ap, _Format);
- __ret = __stdio_common_vsscanf(0, _Src, (size_t)-1, _Format, NULL, __ap);
- __builtin_va_end(__ap);
- return __ret;
- }
+ int __cdecl sscanf(const char * __restrict__ _Src,const char * __restrict__
_Format,...) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
#ifdef _GNU_SOURCE
__attribute__ ((__format__ (__MINGW_PRINTF_FORMAT, 2, 0)))
int __cdecl vasprintf(char ** __restrict__ _Ret,const char * __restrict__
_Format,va_list _Args);
@@ -537,25 +510,13 @@ int vsnprintf (char *__stream, size_t __n, const char
*__format, __builtin_va_li
int __cdecl asprintf(char ** __restrict__ _Ret,const char * __restrict__
_Format,...);
#endif /*_GNU_SOURCE*/
- __mingw_ovr
__attribute__((__format__ (__MINGW_SCANF_FORMAT, 2, 0)))
__MINGW_ATTRIB_NONNULL(2)
- int vfscanf (FILE *__stream, const char *__format, __builtin_va_list
__local_argv)
- {
- return __stdio_common_vfscanf(0, __stream, __format, NULL, __local_argv);
- }
+ int vfscanf (FILE *__stream, const char *__format, __builtin_va_list
__local_argv);
- __mingw_ovr
__attribute__((__format__ (__MINGW_SCANF_FORMAT, 2, 0)))
__MINGW_ATTRIB_NONNULL(2)
- int vsscanf (const char * __restrict__ __source, const char * __restrict__
__format, __builtin_va_list __local_argv)
- {
- return __stdio_common_vsscanf(0, __source, (size_t)-1, __format, NULL,
__local_argv);
- }
- __mingw_ovr
+ int vsscanf (const char * __restrict__ __source, const char * __restrict__
__format, __builtin_va_list __local_argv);
__attribute__((__format__ (__MINGW_SCANF_FORMAT, 1, 0)))
__MINGW_ATTRIB_NONNULL(1)
- int vscanf(const char *__format, __builtin_va_list __local_argv)
- {
- return __stdio_common_vfscanf(0, stdin, __format, NULL, __local_argv);
- }
+ int vscanf(const char *__format, __builtin_va_list __local_argv);
#ifdef __GNUC__
#pragma GCC diagnostic pop
--
2.25.1
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public