I do not yet completely understand all aspects of mingw-w64's build process 
(which, for example, caused issues with btowc and wctob in this patch series), 
but I wonder if we could add Makefile.am to testcases subdirectory and define 
all tests in that Makefile.am instead of top-level one?

This would allow us, for example, override value of ___MSVCRT_VERSION__ when 
compiling tests. I think It would make sense to define it to the value 
corresponding to CRT specified with --with-default-msvcrt configure option?

- Kirill Makurin
________________________________
From: Martin Storsjö <mar...@martin.st>
Sent: Monday, July 14, 2025 5:56 PM
To: LIU Hao <lh_mo...@126.com>
Cc: mingw-w64-public@lists.sourceforge.net 
<mingw-w64-public@lists.sourceforge.net>; Kirill Makurin 
<maiddais...@outlook.com>
Subject: Re: [Mingw-w64-public] New implementation for C95 conversion functions

On Mon, 14 Jul 2025, LIU Hao wrote:

> 在 2025-7-14 05:04, Kirill Makurin 写道:
>> The replacements for mb*towc* and wc*tomb* functions are currently used
>> only for pre-msvcr80.dll (including all msvcrt.dll). The tests should
>> be skipped by returning 77 when compiled for msvcr80.dll and later
>> (including UCRT).
>>
>> Is it possible that me checking `__MSVCRT_VERSION__ >= 0x0800` is
>> incorrect?
>
> It is not incorrect, and I don't see such an error:
>
>   UCRT64 ~/Desktop
>   $ gcc
> 'D:\lh_mouse\GitHub\mingw-w64\mingw-w64-crt\testcases\t_wcsrtombs.c' ;
> ./a.exe ; echo $?
>   77

Sorry for the noise - it does indeed work as expected. The problem was
with the way of individually overriding CFLAGS for the tests, which is
very prone to typos and mistakes - I had typos in two test names. With
those fixes in place, it runs fine.

That's exactly why I'd prefer to find a less fiddly way of resetting
CFLAGS for the tests, for merging upstream.

// Martin


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

Reply via email to