On Sat, 13 Dec 2025, Luca Bacci wrote:

diff --git a/mingw-w64-crt/crt/crtexe.c b/mingw-w64-crt/crt/crtexe.c
index 94bad6aa..d7497ef0 100644
--- a/mingw-w64-crt/crt/crtexe.c
+++ b/mingw-w64-crt/crt/crtexe.c
@@ -199,6 +199,17 @@ __tmainCRTStartup (void)
      if (__globallocalestatus == -1)
        _configthreadlocale (-1);

+#if !defined (_UCRT)

This doesn't work the way you want; as much as possible of the base files from mingw-w64-crt are agnostic of the choice of default CRT. In particular, all the files in mingw-w64-crt are built with "-D__MSVCRT_VERSION__=0x600". Only the files that go into the individual CRT import libraries can assume things about which CRT they're used with.

One way of working around this would be to add a call to a function, which in the libmsvcr*.a libraries does what you want, but in libucrt*.a would be a dummy no-op function.

Pali may have other suggestions or opinions about how to deal with this.

// Martin



_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to