Re: [Mingw-w64-public] [PATCH 2/2] headers: Use corecrt_stdio_config.h instead of local UCRTBASE_* defines.

2020-06-08 Thread Martin Storsjö

On Sun, 7 Jun 2020, Jacek Caban wrote:


Signed-off-by: Jacek Caban 
---
mingw-w64-headers/crt/conio.h   | 37 +++--
mingw-w64-headers/crt/sec_api/stdio_s.h | 26 -
mingw-w64-headers/crt/sec_api/wchar_s.h | 12 ++--
mingw-w64-headers/crt/stdio.h   | 59 ++--
mingw-w64-headers/crt/wchar.h   | 74 +
5 files changed, 70 insertions(+), 138 deletions(-)


Looks sensible, although I didn't proofread it in detail. Thanks!

// Martin



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


[Mingw-w64-public] [PATCH 2/2] headers: Use corecrt_stdio_config.h instead of local UCRTBASE_* defines.

2020-06-07 Thread Jacek Caban

Signed-off-by: Jacek Caban 
---
 mingw-w64-headers/crt/conio.h   | 37 +++--
 mingw-w64-headers/crt/sec_api/stdio_s.h | 26 -
 mingw-w64-headers/crt/sec_api/wchar_s.h | 12 ++--
 mingw-w64-headers/crt/stdio.h   | 59 ++--
 mingw-w64-headers/crt/wchar.h   | 74 +
 5 files changed, 70 insertions(+), 138 deletions(-)


diff --git a/mingw-w64-headers/crt/conio.h b/mingw-w64-headers/crt/conio.h
index ff582c2b..b28a71c2 100644
--- a/mingw-w64-headers/crt/conio.h
+++ b/mingw-w64-headers/crt/conio.h
@@ -7,32 +7,9 @@
 #define _INC_CONIO
 
 #include 
+#include 
 #include 
 
-#if !defined(_UCRTBASE_STDIO_DEFINED) && defined(_UCRT)
-#define _UCRTBASE_STDIO_DEFINED
-
-#define UCRTBASE_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION (0x0001)
-#define UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR  (0x0002)
-#define UCRTBASE_PRINTF_LEGACY_WIDE_SPECIFIERS   (0x0004)
-#define UCRTBASE_PRINTF_LEGACY_MSVCRT_COMPATIBILITY  (0x0008)
-#define UCRTBASE_PRINTF_LEGACY_THREE_DIGIT_EXPONENTS (0x0010)
-
-#define UCRTBASE_SCANF_SECURECRT (0x0001)
-#define UCRTBASE_SCANF_LEGACY_WIDE_SPECIFIERS(0x0002)
-#define UCRTBASE_SCANF_LEGACY_MSVCRT_COMPATIBILITY   (0x0004)
-
-/* Default wide printfs and scanfs to the legacy wide mode. Only code built
- * with -D__USE_MINGW_ANSI_STDIO=1 will expect the standard behaviour. */
-#ifndef UCRTBASE_PRINTF_DEFAULT_WIDE
-#define UCRTBASE_PRINTF_DEFAULT_WIDE UCRTBASE_PRINTF_LEGACY_WIDE_SPECIFIERS
-#endif
-#ifndef UCRTBASE_SCANF_DEFAULT_WIDE
-#define UCRTBASE_SCANF_DEFAULT_WIDE UCRTBASE_SCANF_LEGACY_WIDE_SPECIFIERS
-#endif
-#endif
-
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -171,7 +148,7 @@ extern "C" {
 
   __mingw_ovr int __cdecl _vcwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList)
   {
-return __conio_common_vcwprintf(UCRTBASE_PRINTF_DEFAULT_WIDE, _Format, NULL, _ArgList);
+return __conio_common_vcwprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _Format, NULL, _ArgList);
   }
   __mingw_ovr int __cdecl _cwprintf(const wchar_t * __restrict__ _Format,...)
   {
@@ -187,7 +164,7 @@ extern "C" {
 __builtin_va_list _ArgList;
 int _Ret;
 __builtin_va_start(_ArgList, _Format);
-_Ret = __conio_common_vcwscanf(UCRTBASE_SCANF_DEFAULT_WIDE, _Format, NULL, _ArgList);
+_Ret = __conio_common_vcwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, _Format, NULL, _ArgList);
 __builtin_va_end(_ArgList);
 return _Ret;
   }
@@ -196,13 +173,13 @@ extern "C" {
 __builtin_va_list _ArgList;
 int _Ret;
 __builtin_va_start(_ArgList, _Locale);
-_Ret = __conio_common_vcwscanf(UCRTBASE_SCANF_DEFAULT_WIDE, _Format, _Locale, _ArgList);
+_Ret = __conio_common_vcwscanf(_CRT_INTERNAL_LOCAL_SCANF_OPTIONS, _Format, _Locale, _ArgList);
 __builtin_va_end(_ArgList);
 return _Ret;
   }
   __mingw_ovr int __cdecl _vcwprintf_p(const wchar_t * __restrict__ _Format,va_list _ArgList)
   {
-return __conio_common_vcwprintf_p(UCRTBASE_PRINTF_DEFAULT_WIDE, _Format, NULL, _ArgList);
+return __conio_common_vcwprintf_p(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _Format, NULL, _ArgList);
   }
   __mingw_ovr int __cdecl _cwprintf_p(const wchar_t * __restrict__ _Format,...)
   {
@@ -215,7 +192,7 @@ extern "C" {
   }
   __mingw_ovr int __cdecl _vcwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList)
   {
-return __conio_common_vcwprintf(UCRTBASE_PRINTF_DEFAULT_WIDE, _Format, _Locale, _ArgList);
+return __conio_common_vcwprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _Format, _Locale, _ArgList);
   }
   __mingw_ovr int __cdecl _cwprintf_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...)
   {
@@ -228,7 +205,7 @@ extern "C" {
   }
   __mingw_ovr int __cdecl _vcwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,va_list _ArgList)
   {
-return __conio_common_vcwprintf_p(UCRTBASE_PRINTF_DEFAULT_WIDE, _Format, _Locale, _ArgList);
+return __conio_common_vcwprintf_p(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _Format, _Locale, _ArgList);
   }
   __mingw_ovr int __cdecl _cwprintf_p_l(const wchar_t * __restrict__ _Format,_locale_t _Locale,...)
   {
diff --git a/mingw-w64-headers/crt/sec_api/stdio_s.h b/mingw-w64-headers/crt/sec_api/stdio_s.h
index fd21d3ad..c6350e8d 100644
--- a/mingw-w64-headers/crt/sec_api/stdio_s.h
+++ b/mingw-w64-headers/crt/sec_api/stdio_s.h
@@ -39,7 +39,7 @@ extern "C" {
 
   __mingw_ovr int __cdecl _vfscanf_s_l(FILE *_File, const char *_Format, _locale_t _Locale, va_list _ArgList)
   {
-return __stdio_common_vfscanf(UCRTBASE_SCANF_SECURECRT, _File, _Format, _Locale, _ArgList);
+return __stdio_common_vfscanf(_CRT_INTERNAL_SCANF_SECURECRT, _File, _Format, _Locale, _ArgList);
   }
   __mingw_ovr int __cdecl _fscanf_s_l(FILE *_File, const char *_Format, _locale_t _Locale, ...)
   {
@@ -85,7 +85,7 @@ extern "C" {
 
   __mingw_ovr int __cdecl _vsscanf_s_l(const char *_Src, const char *_Format,