Signed-off-by: Martin Storsjö <mar...@martin.st> --- mingw-w64-crt/Makefile.am | 6 ++++ mingw-w64-crt/stdio/ucrt_fwscanf.c | 19 ++++++++++ mingw-w64-crt/stdio/ucrt_swscanf.c | 20 +++++++++++ mingw-w64-crt/stdio/ucrt_vfwscanf.c | 14 ++++++++ mingw-w64-crt/stdio/ucrt_vswscanf.c | 14 ++++++++ mingw-w64-crt/stdio/ucrt_vwscanf.c | 14 ++++++++ mingw-w64-crt/stdio/ucrt_wscanf.c | 19 ++++++++++ mingw-w64-headers/crt/stdio.h | 54 +++++------------------------ mingw-w64-headers/crt/wchar.h | 54 +++++------------------------ 9 files changed, 124 insertions(+), 90 deletions(-) create mode 100644 mingw-w64-crt/stdio/ucrt_fwscanf.c create mode 100644 mingw-w64-crt/stdio/ucrt_swscanf.c create mode 100644 mingw-w64-crt/stdio/ucrt_vfwscanf.c create mode 100644 mingw-w64-crt/stdio/ucrt_vswscanf.c create mode 100644 mingw-w64-crt/stdio/ucrt_vwscanf.c create mode 100644 mingw-w64-crt/stdio/ucrt_wscanf.c
diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am index ad8bb94f0..1fb0fd911 100644 --- a/mingw-w64-crt/Makefile.am +++ b/mingw-w64-crt/Makefile.am @@ -413,6 +413,7 @@ src_ucrtbase=\ stdio/ucrt_fprintf.c \ stdio/ucrt_fscanf.c \ stdio/ucrt_fwprintf.c \ + stdio/ucrt_fwscanf.c \ stdio/ucrt_ms_fprintf.c \ stdio/ucrt_ms_fwprintf.c \ stdio/ucrt_printf.c \ @@ -422,9 +423,11 @@ src_ucrtbase=\ stdio/ucrt_sprintf.c \ stdio/ucrt_sscanf.c \ stdio/ucrt_swprintf.c \ + stdio/ucrt_swscanf.c \ stdio/ucrt_vfprintf.c \ stdio/ucrt_vfscanf.c \ stdio/ucrt_vfwprintf.c \ + stdio/ucrt_vfwscanf.c \ stdio/ucrt_vprintf.c \ stdio/ucrt_vscanf.c \ stdio/ucrt_vsnprintf.c \ @@ -432,8 +435,11 @@ src_ucrtbase=\ stdio/ucrt_vsprintf.c \ stdio/ucrt_vswprintf.c \ stdio/ucrt_vsscanf.c \ + stdio/ucrt_vswscanf.c \ stdio/ucrt_vwprintf.c \ + stdio/ucrt_vwscanf.c \ stdio/ucrt_wprintf.c \ + stdio/ucrt_wscanf.c \ string/ucrt__wcstok.c # Files included in libucrtapp.a diff --git a/mingw-w64-crt/stdio/ucrt_fwscanf.c b/mingw-w64-crt/stdio/ucrt_fwscanf.c new file mode 100644 index 000000000..cc7d4f92c --- /dev/null +++ b/mingw-w64-crt/stdio/ucrt_fwscanf.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 fwscanf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...) { + __builtin_va_list __ap; + int __ret; + __builtin_va_start(__ap, _Format); + __ret = __stdio_common_vfwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, _File, _Format, NULL, __ap); + __builtin_va_end(__ap); + return __ret; +} +int __cdecl (*__MINGW_IMP_SYMBOL(fwscanf))(FILE *__restrict__, const wchar_t *__restrict__, ...) = fwscanf; diff --git a/mingw-w64-crt/stdio/ucrt_swscanf.c b/mingw-w64-crt/stdio/ucrt_swscanf.c new file mode 100644 index 000000000..036ddcca8 --- /dev/null +++ b/mingw-w64-crt/stdio/ucrt_swscanf.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 swscanf(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,...) { + __builtin_va_list __ap; + int __ret; + __builtin_va_start(__ap, _Format); + __ret = __stdio_common_vswscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, _Src, (size_t)-1, _Format, NULL, __ap); + __builtin_va_end(__ap); + return __ret; +} + +int __cdecl (*__MINGW_IMP_SYMBOL(swscanf))(const wchar_t *__restrict__, const wchar_t *__restrict__, ...) = swscanf; diff --git a/mingw-w64-crt/stdio/ucrt_vfwscanf.c b/mingw-w64-crt/stdio/ucrt_vfwscanf.c new file mode 100644 index 000000000..ed717b145 --- /dev/null +++ b/mingw-w64-crt/stdio/ucrt_vfwscanf.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 vfwscanf (FILE *__stream, const wchar_t *__format, __builtin_va_list __local_argv) { + return __stdio_common_vfwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, __stream, __format, NULL, __local_argv); +} +int __cdecl (*__MINGW_IMP_SYMBOL(vfwscanf))(FILE *, const wchar_t *, __builtin_va_list) = vfwscanf; diff --git a/mingw-w64-crt/stdio/ucrt_vswscanf.c b/mingw-w64-crt/stdio/ucrt_vswscanf.c new file mode 100644 index 000000000..664f75746 --- /dev/null +++ b/mingw-w64-crt/stdio/ucrt_vswscanf.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 vswscanf (const wchar_t * __restrict__ __source, const wchar_t * __restrict__ __format, __builtin_va_list __local_argv) { + return __stdio_common_vswscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, __source, (size_t)-1, __format, NULL, __local_argv); +} +int __cdecl (*__MINGW_IMP_SYMBOL(vswscanf))(const wchar_t *__restrict, const wchar_t *__restrict__, __builtin_va_list) = vswscanf; diff --git a/mingw-w64-crt/stdio/ucrt_vwscanf.c b/mingw-w64-crt/stdio/ucrt_vwscanf.c new file mode 100644 index 000000000..758fc6643 --- /dev/null +++ b/mingw-w64-crt/stdio/ucrt_vwscanf.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 vwscanf(const wchar_t *__format, __builtin_va_list __local_argv) { + return __stdio_common_vfwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, stdin, __format, NULL, __local_argv); +} +int __cdecl (*__MINGW_IMP_SYMBOL(vwscanf))(const wchar_t *, __builtin_va_list) = vwscanf; diff --git a/mingw-w64-crt/stdio/ucrt_wscanf.c b/mingw-w64-crt/stdio/ucrt_wscanf.c new file mode 100644 index 000000000..f45779dbb --- /dev/null +++ b/mingw-w64-crt/stdio/ucrt_wscanf.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 wscanf(const wchar_t * __restrict__ _Format,...) { + __builtin_va_list __ap; + int __ret; + __builtin_va_start(__ap, _Format); + __ret = __stdio_common_vfwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, stdin, _Format, NULL, __ap); + __builtin_va_end(__ap); + return __ret; +} +int __cdecl (*__MINGW_IMP_SYMBOL(wscanf))(const wchar_t *__restrict__, ...) = wscanf; diff --git a/mingw-w64-headers/crt/stdio.h b/mingw-w64-headers/crt/stdio.h index bc24cce39..779561588 100644 --- a/mingw-w64-headers/crt/stdio.h +++ b/mingw-w64-headers/crt/stdio.h @@ -1062,55 +1062,19 @@ int vsnwprintf (wchar_t *__stream, size_t __n, const wchar_t *__format, __builti #else /* !__USE_MINGW_ANSI_STDIO */ #ifdef _UCRT - __mingw_ovr __MINGW_ATTRIB_DEPRECATED_SEC_WARN - int __cdecl fwscanf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...) - { - __builtin_va_list __ap; - int __ret; - __builtin_va_start(__ap, _Format); - __ret = __stdio_common_vfwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, _File, _Format, NULL, __ap); - __builtin_va_end(__ap); - return __ret; - } - __mingw_ovr __MINGW_ATTRIB_DEPRECATED_SEC_WARN - int __cdecl swscanf(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,...) - { - __builtin_va_list __ap; - int __ret; - __builtin_va_start(__ap, _Format); - __ret = __stdio_common_vswscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, _Src, (size_t)-1, _Format, NULL, __ap); - __builtin_va_end(__ap); - return __ret; - } - __mingw_ovr __MINGW_ATTRIB_DEPRECATED_SEC_WARN - int __cdecl wscanf(const wchar_t * __restrict__ _Format,...) - { - __builtin_va_list __ap; - int __ret; - __builtin_va_start(__ap, _Format); - __ret = __stdio_common_vfwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, stdin, _Format, NULL, __ap); - __builtin_va_end(__ap); - return __ret; - } - __mingw_ovr + __MINGW_ATTRIB_DEPRECATED_SEC_WARN + int __cdecl fwscanf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...); + __MINGW_ATTRIB_DEPRECATED_SEC_WARN + int __cdecl swscanf(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,...); + __MINGW_ATTRIB_DEPRECATED_SEC_WARN + int __cdecl wscanf(const wchar_t * __restrict__ _Format,...); __MINGW_ATTRIB_NONNULL(2) - int vfwscanf (FILE *__stream, const wchar_t *__format, va_list __local_argv) - { - return __stdio_common_vfwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, __stream, __format, NULL, __local_argv); - } + int vfwscanf (FILE *__stream, const wchar_t *__format, va_list __local_argv); - __mingw_ovr __MINGW_ATTRIB_NONNULL(2) - int vswscanf (const wchar_t * __restrict__ __source, const wchar_t * __restrict__ __format, va_list __local_argv) - { - return __stdio_common_vswscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, __source, (size_t)-1, __format, NULL, __local_argv); - } - __mingw_ovr + int vswscanf (const wchar_t * __restrict__ __source, const wchar_t * __restrict__ __format, va_list __local_argv); __MINGW_ATTRIB_NONNULL(1) - int vwscanf(const wchar_t *__format, va_list __local_argv) - { - return __stdio_common_vfwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, stdin, __format, NULL, __local_argv); - } + int vwscanf(const wchar_t *__format, va_list __local_argv); int __cdecl fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...); int __cdecl wprintf(const wchar_t * __restrict__ _Format,...); diff --git a/mingw-w64-headers/crt/wchar.h b/mingw-w64-headers/crt/wchar.h index 6c1873420..a66573981 100644 --- a/mingw-w64-headers/crt/wchar.h +++ b/mingw-w64-headers/crt/wchar.h @@ -433,55 +433,19 @@ __MINGW_ASM_CALL(__mingw_vsnwprintf); #else /* !__USE_MINGW_ANSI_STDIO */ #ifdef _UCRT - __mingw_ovr __MINGW_ATTRIB_DEPRECATED_SEC_WARN - int __cdecl fwscanf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...) - { - __builtin_va_list __ap; - int __ret; - __builtin_va_start(__ap, _Format); - __ret = __stdio_common_vfwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, _File, _Format, NULL, __ap); - __builtin_va_end(__ap); - return __ret; - } - __mingw_ovr __MINGW_ATTRIB_DEPRECATED_SEC_WARN - int __cdecl swscanf(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,...) - { - __builtin_va_list __ap; - int __ret; - __builtin_va_start(__ap, _Format); - __ret = __stdio_common_vswscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, _Src, (size_t)-1, _Format, NULL, __ap); - __builtin_va_end(__ap); - return __ret; - } - __mingw_ovr __MINGW_ATTRIB_DEPRECATED_SEC_WARN - int __cdecl wscanf(const wchar_t * __restrict__ _Format,...) - { - __builtin_va_list __ap; - int __ret; - __builtin_va_start(__ap, _Format); - __ret = __stdio_common_vfwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, stdin, _Format, NULL, __ap); - __builtin_va_end(__ap); - return __ret; - } - __mingw_ovr + __MINGW_ATTRIB_DEPRECATED_SEC_WARN + int __cdecl fwscanf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...); + __MINGW_ATTRIB_DEPRECATED_SEC_WARN + int __cdecl swscanf(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,...); + __MINGW_ATTRIB_DEPRECATED_SEC_WARN + int __cdecl wscanf(const wchar_t * __restrict__ _Format,...); __MINGW_ATTRIB_NONNULL(2) - int vfwscanf (FILE *__stream, const wchar_t *__format, va_list __local_argv) - { - return __stdio_common_vfwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, __stream, __format, NULL, __local_argv); - } + int vfwscanf (FILE *__stream, const wchar_t *__format, va_list __local_argv); - __mingw_ovr __MINGW_ATTRIB_NONNULL(2) - int vswscanf (const wchar_t * __restrict__ __source, const wchar_t * __restrict__ __format, va_list __local_argv) - { - return __stdio_common_vswscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, __source, (size_t)-1, __format, NULL, __local_argv); - } - __mingw_ovr + int vswscanf (const wchar_t * __restrict__ __source, const wchar_t * __restrict__ __format, va_list __local_argv); __MINGW_ATTRIB_NONNULL(1) - int vwscanf(const wchar_t *__format, va_list __local_argv) - { - return __stdio_common_vfwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, stdin, __format, NULL, __local_argv); - } + int vwscanf(const wchar_t *__format, va_list __local_argv); int __cdecl fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...); int __cdecl wprintf(const wchar_t * __restrict__ _Format,...); -- 2.43.0 _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public