In these cases, the default ucrt functions already are C99 compatible,
so even if the caller has requested to use the mingw version, by
defining __USE_MINGW_ANSI_STDIO, the ucrt version should be fine.

Or does there exit any case with non-C99, mingw specific features that
a caller would expect to be available when this define is set?
---
This is a little bit messy, but we probably don't want to do a simple
undef of the macro either - we e.g. probably want to pick up the inttypes.h
version for __USE_MINGW_ANSI_STDIO anyway.

Or should we just undef it and adjust inttypes.h and similar ones to
check __MSVCRT_VERSION__ instead?

Jacek, I remember we discussed this at some point early on in the ucrt
process, but I didn't want to pursue it quite then. I think things have
settled down wrt ucrt pretty well otherwise so far, so we might want to
look into this.
---
 mingw-w64-headers/crt/stdio.h  | 20 ++++++++++----------
 mingw-w64-headers/crt/stdlib.h |  2 +-
 mingw-w64-headers/crt/wchar.h  | 12 ++++++------
 3 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/mingw-w64-headers/crt/stdio.h b/mingw-w64-headers/crt/stdio.h
index d981f70..ba03ec9 100644
--- a/mingw-w64-headers/crt/stdio.h
+++ b/mingw-w64-headers/crt/stdio.h
@@ -231,7 +231,7 @@ extern
 #define __MINGW_SCANF_FORMAT  ms_scanf
 #endif
 
-#if __USE_MINGW_ANSI_STDIO
+#if __USE_MINGW_ANSI_STDIO && __MSVCRT_VERSION__ < 0x1400
 /*
  * User has expressed a preference for C99 conformance...
  */
@@ -411,7 +411,7 @@ int vsnprintf (char *__stream, size_t __n, const char 
*__format, __builtin_va_li
 }
 #endif
 
-#else /* !__USE_MINGW_ANSI_STDIO */
+#else /* !__USE_MINGW_ANSI_STDIO || __MSVCRT_VERSION__ >= 0x1400 */
 
 #undef __builtin_vsnprintf
 #undef __builtin_vsprintf
@@ -566,7 +566,7 @@ int vsnprintf (char *__stream, size_t __n, const char 
*__format, __builtin_va_li
 
 #endif /* __NO_ISOCEXT */
 #endif /* __MSVCRT_VERSION__ >= 0x1400 */
-#endif /* __USE_MINGW_ANSI_STDIO */
+#endif /* __USE_MINGW_ANSI_STDIO && __MSVCRT_VERSION__ < 0x1400 */
 
   _CRTIMP int __cdecl _filbuf(FILE *_File);
   _CRTIMP int __cdecl _flsbuf(int _Ch,FILE *_File);
@@ -737,7 +737,7 @@ int vsnprintf (char *__stream, size_t __n, const char 
*__format, __builtin_va_li
   _CRTIMP int __cdecl _vsnprintf(char * __restrict__ _Dest,size_t _Count,const 
char * __restrict__ _Format,va_list _Args) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
 #endif
 
-#if !defined (__USE_MINGW_ANSI_STDIO) || __USE_MINGW_ANSI_STDIO == 0
+#if !defined (__USE_MINGW_ANSI_STDIO) || __USE_MINGW_ANSI_STDIO == 0 || 
__MSVCRT_VERSION__ >= 0x1400
 
 #if __MSVCRT_VERSION__ >= 0x1400
 #ifdef __GNUC__
@@ -799,7 +799,7 @@ int snprintf (char * __restrict__ __stream, size_t __n, 
const char * __restrict_
 #pragma GCC diagnostic pop
 #endif
 #endif /* __MSVCRT_VERSION__ >= 0x1400 */
-#endif /* __USE_MINGW_ANSI_STDIO */
+#endif /* __USE_MINGW_ANSI_STDIO && __MSVCRT_VERSION__ < 0x1400 */
 
 #if __MSVCRT_VERSION__ >= 0x1400
   __mingw_ovr
@@ -854,7 +854,7 @@ int snprintf (char * __restrict__ __stream, size_t __n, 
const char * __restrict_
   int __cdecl __stdio_common_vfwscanf(unsigned __int64 options, FILE *file, 
const wchar_t *format, _locale_t locale, va_list valist);
 #endif
 
-#if __USE_MINGW_ANSI_STDIO
+#if __USE_MINGW_ANSI_STDIO && __MSVCRT_VERSION__ < 0x1400
 /*
  * User has expressed a preference for C99 conformance...
  */
@@ -973,7 +973,7 @@ int vsnwprintf (wchar_t *__stream, size_t __n, const 
wchar_t *__format, __builti
 }
 #endif /* __NO_ISOCEXT */
 
-#else /* !__USE_MINGW_ANSI_STDIO */
+#else /* !__USE_MINGW_ANSI_STDIO || __MSVCRT_VERSION__ >= 0x1400 */
 
 #if __MSVCRT_VERSION__ >= 0x1400
   __mingw_ovr
@@ -1093,7 +1093,7 @@ int vsnwprintf (wchar_t *__stream, size_t __n, const 
wchar_t *__format, __builti
   int __cdecl vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ 
_Format,va_list _ArgList);
   int __cdecl vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList);
 #endif /* __MSVCRT_VERSION__ >= 0x1400 */
-#endif /* __USE_MINGW_ANSI_STDIO */
+#endif /* __USE_MINGW_ANSI_STDIO && __MSVCRT_VERSION__ < 0x1400 */
 
 #ifndef WEOF
 #define WEOF (wint_t)(0xFFFF)
@@ -1142,7 +1142,7 @@ int vsnwprintf (wchar_t *__stream, size_t __n, const 
wchar_t *__format, __builti
   }
   int __cdecl _vsnwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const 
wchar_t * __restrict__ _Format,va_list _Args) 
__MINGW_ATTRIB_DEPRECATED_SEC_WARN;
 
-#if !defined (__USE_MINGW_ANSI_STDIO) || __USE_MINGW_ANSI_STDIO == 0
+#if !defined (__USE_MINGW_ANSI_STDIO) || __USE_MINGW_ANSI_STDIO == 0 || 
__MSVCRT_VERSION__ >= 0x1400
   __mingw_ovr
   int snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * 
__restrict__ format, ...)
   {
@@ -1192,7 +1192,7 @@ int vsnwprintf (wchar_t *__stream, size_t __n, const 
wchar_t *__format, __builti
 
 #ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
 
-#if !defined (__USE_MINGW_ANSI_STDIO) || __USE_MINGW_ANSI_STDIO == 0
+#if !defined (__USE_MINGW_ANSI_STDIO) || __USE_MINGW_ANSI_STDIO == 0 || 
__MSVCRT_VERSION__ >= 0x1400
 #pragma push_macro("snwprintf")
 #pragma push_macro("vsnwprintf")
 # undef snwprintf
diff --git a/mingw-w64-headers/crt/stdlib.h b/mingw-w64-headers/crt/stdlib.h
index 4d9c1d9..a67fae0 100644
--- a/mingw-w64-headers/crt/stdlib.h
+++ b/mingw-w64-headers/crt/stdlib.h
@@ -9,7 +9,7 @@
 #include <crtdefs.h>
 #include <limits.h>
 
-#if defined (__USE_MINGW_ANSI_STDIO) && ((__USE_MINGW_ANSI_STDIO + 0) != 0) && 
!defined (__USE_MINGW_STRTOX)
+#if defined (__USE_MINGW_ANSI_STDIO) && ((__USE_MINGW_ANSI_STDIO + 0) != 0) && 
!defined (__USE_MINGW_STRTOX) && __MSVCRT_VERSION__ < 0x1400
 #define __USE_MINGW_STRTOX 1
 #endif
 
diff --git a/mingw-w64-headers/crt/wchar.h b/mingw-w64-headers/crt/wchar.h
index ce041ad..2d759c7 100644
--- a/mingw-w64-headers/crt/wchar.h
+++ b/mingw-w64-headers/crt/wchar.h
@@ -517,7 +517,7 @@ extern FILE (* __MINGW_IMP_SYMBOL(_iob))[]; /* A pointer to 
an array of FILE */
 #define __mingw_ovr static __cdecl
 #endif
 
-#if __USE_MINGW_ANSI_STDIO
+#if __USE_MINGW_ANSI_STDIO && __MSVCRT_VERSION__ < 0x1400
 
 /*
  * User has expressed a preference for C99 conformance...
@@ -635,7 +635,7 @@ int vsnwprintf (wchar_t *__stream, size_t __n, const 
wchar_t *__format, __builti
   return __mingw_vsnwprintf( __stream, __n, __format, __local_argv );
 }
 /* #endif */ /* __NO_ISOCEXT */
-#else /* !__USE_MINGW_ANSI_STDIO */
+#else /* !__USE_MINGW_ANSI_STDIO || __MSVCRT_VERSION__ >= 0x1400 */
 
 #if __MSVCRT_VERSION__ >= 0x1400
   __mingw_ovr
@@ -755,7 +755,7 @@ int vsnwprintf (wchar_t *__stream, size_t __n, const 
wchar_t *__format, __builti
   int __cdecl vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ 
_Format,va_list _ArgList);
   int __cdecl vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList);
 #endif /* __MSVCRT_VERSION__ >= 0x1400 */
-#endif /* __USE_MINGW_ANSI_STDIO */
+#endif /* __USE_MINGW_ANSI_STDIO && __MSVCRT_VERSION__ < 0x1400 */
 
 
 #ifndef WEOF
@@ -809,7 +809,7 @@ int vsnwprintf (wchar_t *__stream, size_t __n, const 
wchar_t *__format, __builti
     return __stdio_common_vswprintf(UCRTBASE_PRINTF_DEFAULT_WIDE | 
UCRTBASE_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION, _Dest, _Count, _Format, NULL, 
_Args);
   }
 
-#if !defined (__USE_MINGW_ANSI_STDIO) || __USE_MINGW_ANSI_STDIO == 0
+#if !defined (__USE_MINGW_ANSI_STDIO) || __USE_MINGW_ANSI_STDIO == 0 || 
__MSVCRT_VERSION__ >= 0x1400
   __mingw_ovr
   int snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * 
__restrict__ format, ...)
   {
@@ -837,7 +837,7 @@ int vsnwprintf (wchar_t *__stream, size_t __n, const 
wchar_t *__format, __builti
 
 #ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
 
-#if !defined (__USE_MINGW_ANSI_STDIO) || __USE_MINGW_ANSI_STDIO == 0
+#if !defined (__USE_MINGW_ANSI_STDIO) || __USE_MINGW_ANSI_STDIO == 0 || 
__MSVCRT_VERSION__ >= 0x1400
 #pragma push_macro("snwprintf")
 #pragma push_macro("vsnwprintf")
 # undef snwprintf
@@ -1241,7 +1241,7 @@ int vsnwprintf (wchar_t *__stream, size_t __n, const 
wchar_t *__format, __builti
   float __cdecl __mingw_wcstof(const wchar_t * __restrict__ nptr, wchar_t ** 
__restrict__ endptr);
   long double __cdecl __mingw_wcstold(const wchar_t * __restrict__, wchar_t ** 
__restrict__);
 
-#if __USE_MINGW_ANSI_STDIO
+#if __USE_MINGW_ANSI_STDIO && __MSVCRT_VERSION__ < 0x1400
   __mingw_ovr
   double __cdecl wcstod(const wchar_t * __restrict__ _Str,wchar_t ** 
__restrict__ _EndPtr){
     return __mingw_wcstod(_Str,_EndPtr);
-- 
2.7.4


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to