Hi Jacek,

On Wed, 13 Sep 2017, Jacek Caban wrote:

Hi Martin,

On 11.09.2017 14:48, Martin Storsjö wrote:

 #undef __mingw_ovr
 #if defined (__GNUC__)
 #define __mingw_ovr static __attribute__ ((__unused__)) __inline__ __cdecl
@@ -497,7 +544,11 @@ int wscanf(const wchar_t *__format, ...)
 {
   register int __retval;
   __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __forma
t );
+#if __MSVCRT_VERSION__ >= 0x1400
+  __retval = __mingw_vfwscanf( stdin, __format, __local_argv );
+#else
   __retval = __mingw_vwscanf( __format, __local_argv );
+#endif


Is there a reason not to do that for msvcrt versions? This would avoid a bit
of complexity that doesn't seem needed. Same to other similar cases.

Mostly to avoid changing anything for previous configurations, to reduce risk of breaking anything. Ideally, I tried to make sure that this patchset shouldn't change any codepath for the existing msvcrt.dll setups.

This kind of harmless adjustments for the normal codepaths, to make the ucrtbase case easier, probably can be done in a separate patch afterwards - then it's easier to explain it in a commit message specific to exactly this area. Then one can perhaps even get rid of the __mingw_vwscanf() function altogether, since all it does is fetch stdin and call __mingw_vwfscanf() anyway.

There are also other opportunities to adjust the common CRT init code a little, to avoid some parts of the compat kludge in patch 3/3.

// Martin
------------------------------------------------------------------------------
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