Re: [Mingw-w64-public] [PATCH 8/8] headers: Fix non-standard C++ two-argument swprintf() function

2025-05-06 Thread Martin Storsjö
On Sun, 4 May 2025, Pali Rohár wrote: Currently this function can be compiled by g++ only with -O1 (or up) because it uses __builtin_va_arg_pack(). Both non-standard C++ two-argument swprintf() and vswprintf() functions are just redirection to _swprintf() and _vswprintf() functions. So declare

Re: [Mingw-w64-public] [PATCH v2 02/13] crt: Fix mingw-w64 emulation of _fstat64i32, _stat64i32 and _wstat64i32 functions

2025-05-06 Thread Martin Storsjö
On Tue, 6 May 2025, Pali Rohár wrote: On Tuesday 06 May 2025 22:16:16 Martin Storsjö wrote: On Tue, 6 May 2025, Pali Rohár wrote: On Sunday 13 April 2025 18:34:33 Pali Rohár wrote: All 64-bit CRT import libraries already provides _fstat64i32, _stat64i32 and _wstat64i32 function symbols. Thes

Re: [Mingw-w64-public] [PATCH v2 02/13] crt: Fix mingw-w64 emulation of _fstat64i32, _stat64i32 and _wstat64i32 functions

2025-05-06 Thread Pali Rohár
On Tuesday 06 May 2025 22:16:16 Martin Storsjö wrote: > On Tue, 6 May 2025, Pali Rohár wrote: > > > On Sunday 13 April 2025 18:34:33 Pali Rohár wrote: > > > All 64-bit CRT import libraries already provides _fstat64i32, _stat64i32 > > > and _wstat64i32 function symbols. These symbols are either dir

Re: [Mingw-w64-public] [PATCH v2 02/13] crt: Fix mingw-w64 emulation of _fstat64i32, _stat64i32 and _wstat64i32 functions

2025-05-06 Thread Martin Storsjö
On Tue, 6 May 2025, Pali Rohár wrote: On Sunday 13 April 2025 18:34:33 Pali Rohár wrote: All 64-bit CRT import libraries already provides _fstat64i32, _stat64i32 and _wstat64i32 function symbols. These symbols are either directly exported from 64-bit CRT DLL library or def file contains alias t

Re: [Mingw-w64-public] [PATCH 4/8] crt: Define import symbol for UCRT _snwprintf() function

2025-05-06 Thread Martin Storsjö
On Sun, 4 May 2025, Pali Rohár wrote: --- mingw-w64-crt/stdio/ucrt__snwprintf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mingw-w64-crt/stdio/ucrt__snwprintf.c b/mingw-w64-crt/stdio/ucrt__snwprintf.c index 5f5a435884b3..5e03d269cf63 100644 --- a/mingw-w64-crt/stdio/uc

Re: [Mingw-w64-public] [PATCH v2 02/13] crt: Fix mingw-w64 emulation of _fstat64i32, _stat64i32 and _wstat64i32 functions

2025-05-06 Thread Pali Rohár
On Sunday 13 April 2025 18:34:33 Pali Rohár wrote: > All 64-bit CRT import libraries already provides _fstat64i32, _stat64i32 > and _wstat64i32 function symbols. These symbols are either directly > exported from 64-bit CRT DLL library or def file contains alias to other > ABI compatible symbols (_f

Re: [Mingw-w64-public] [PATCH 2/2] genidl: Check if the DataDirectory[2] is present

2025-05-06 Thread Martin Storsjö
On Sun, 4 May 2025, Pali Rohár wrote: NumberOfRvaAndSizes contains number of entries in DataDirectory[] array. --- mingw-w64-tools/genidl/src/genidl_readpe.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mingw-w64-tools/genidl/src/genidl_readpe.c b/mingw-w64-tools/gen

Re: [Mingw-w64-public] [PATCH 9/9] crt: exe: Remove custom declaration of _fpreset() function

2025-05-06 Thread Martin Storsjö
On Thu, 17 Apr 2025, Pali Rohár wrote: Function _fpreset() is declared in float.h. --- mingw-w64-crt/crt/crtexe.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) Overall about this patchset: 1 - Unclear about the magic undocumented constant, unclear use (__globallocalestatus), but I g

Re: [Mingw-w64-public] [PATCH 6/9] crt: exe: Move mingw-w64 / gcc EXE runtime code into the guarded block

2025-05-06 Thread Martin Storsjö
On Thu, 17 Apr 2025, Pali Rohár wrote: This will ensure that _pei386_runtime_relocator() is called as the first function and that all those runtime init code functions are called in guarded block which prevents duplicate code execution. --- About the purpose of these patches, the "which preven

Re: [Mingw-w64-public] [PATCH 3/9] crt: exe: Invoke gcc c++ constructors after msvc c++ constructors

2025-05-06 Thread Martin Storsjö
On Thu, 17 Apr 2025, Pali Rohár wrote: Function __main() is function for executing gcc c++ constructors. Move it into guarded code which prevents duplicate code execution, after executing msvc c++ constructors (__xc_a-__xc_z callbacks). --- mingw-w64-crt/crt/crtexe.c | 2 +- 1 file changed, 1 ins

Re: [Mingw-w64-public] [PATCH 2/9] crt: exe: Inline pre_c_init() and pre_cpp_init() into _CRT_INIT()

2025-05-06 Thread Martin Storsjö
On Thu, 17 Apr 2025, Pali Rohár wrote: This allows to remove the whole pre_c_init() and pre_cpp_init() functions and registration of __mingw_pcinit and __mingw_pcppinit hooks. Inlining the code allows to easily figure out in which order is initialization code called. Also merge code which is p

[Mingw-w64-public] [PATCH] crt: Add new symbols in ole32 import library

2025-05-06 Thread Biswapriyo Nath
From 131430102444bf2edd9ce02563617487ec0c8c4e Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Tue, 6 May 2025 16:20:39 + Subject: [PATCH] crt: Add new symbols in ole32 import library Required for https://bugzilla.mozilla.org/show_bug.cgi?id=1871472 Signed-off-by: Biswapriyo Nath ---

Re: [Mingw-w64-public] [PATCH 1/9] crt: exe: Enable per-thread locale if user asked for it

2025-05-06 Thread Martin Storsjö
On Tue, 6 May 2025, Martin Storsjö wrote: On Thu, 17 Apr 2025, Pali Rohár wrote: There is missing call _configthreadlocale(-1) in pre_c_init function. Startup code from Visual C++ runtime is doing same thing. This applies only for msvcr80+ and UCRT builds. For older msvcrt versions there is o

Re: [Mingw-w64-public] [PATCH 1/9] crt: exe: Enable per-thread locale if user asked for it

2025-05-06 Thread Pali Rohár
On Tuesday 06 May 2025 17:31:57 Martin Storsjö wrote: > On Thu, 17 Apr 2025, Pali Rohár wrote: > > > There is missing call _configthreadlocale(-1) in pre_c_init function. > > Startup code from Visual C++ runtime is doing same thing. > > > > This applies only for msvcr80+ and UCRT builds. For olde

Re: [Mingw-w64-public] [PATCH 1/9] crt: exe: Enable per-thread locale if user asked for it

2025-05-06 Thread Martin Storsjö
On Thu, 17 Apr 2025, Pali Rohár wrote: There is missing call _configthreadlocale(-1) in pre_c_init function. Startup code from Visual C++ runtime is doing same thing. This applies only for msvcr80+ and UCRT builds. For older msvcrt versions there is only empty wrapper. --- mingw-w64-crt/crt/crt