Previously, the ifdefs were misplaced, leading to this function not
being defined at all if building with __USE_MINGW_ANSI_STDIO=1.

If targeting ucrtbase.dll, we always need to rely on the
__stdio_common_vsprintf implementation, since _vscprintf doesn't
exist in ucrtbase.dll, regardless of the state of the
__USE_MINGW_ANSI_STDIO define.

Signed-off-by: Martin Storsjö <mar...@martin.st>
---
 mingw-w64-headers/crt/stdio.h | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/mingw-w64-headers/crt/stdio.h b/mingw-w64-headers/crt/stdio.h
index d7208e9..dee984a 100644
--- a/mingw-w64-headers/crt/stdio.h
+++ b/mingw-w64-headers/crt/stdio.h
@@ -809,12 +809,6 @@ int vsnprintf (char *__stream, size_t __n, const char 
*__format, __builtin_va_li
     __builtin_va_end(ap);
     return ret;
   }
-
-  __mingw_ovr
-  int __cdecl _vscprintf(const char * __restrict__ _Format,va_list _ArgList)
-  {
-    return 
__stdio_common_vsprintf(UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR, NULL, 0, 
_Format, NULL, _ArgList);
-  }
 #ifdef __GNUC__
 #pragma GCC diagnostic pop
 #endif
@@ -864,10 +858,18 @@ int snprintf (char * __restrict__ __stream, size_t __n, 
const char * __restrict_
 #ifdef __GNUC__
 #pragma GCC diagnostic pop
 #endif
-#endif
+#endif /* __MSVCRT_VERSION__ >= 0x1400 */
+#endif /* __USE_MINGW_ANSI_STDIO */
 
+#if __MSVCRT_VERSION__ >= 0x1400
+  __mingw_ovr
+  int __cdecl _vscprintf(const char * __restrict__ _Format,va_list _ArgList)
+  {
+    return 
__stdio_common_vsprintf(UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR, NULL, 0, 
_Format, NULL, _ArgList);
+  }
+#else
   _CRTIMP int __cdecl _vscprintf(const char * __restrict__ _Format,va_list 
_ArgList);
-#endif /* __MSVCRT_VERSION__ >= 0x1400 */
+#endif
 
   _CRTIMP int __cdecl _set_printf_count_output(int _Value);
   _CRTIMP int __cdecl _get_printf_count_output(void);
-- 
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