Re: [Mingw-w64-public] [PATCH 3/8] crt: Deinline UCRT _vsnwprintf() from wchar.h and define import symbol

2025-05-04 Thread Jacek Caban
On 4.05.2025 11:37, Pali Rohár wrote: Function _vsnwprintf() is already deinlined from stdio.h. Do same in wchar.h and define import symbol. --- mingw-w64-crt/stdio/ucrt__vsnwprintf.c | 1 + mingw-w64-headers/crt/wchar.h | 6 +- 2 files changed, 2 insertions(+), 5 deletions(-)

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

2025-05-04 Thread Pali Rohár
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/genidl/src/genidl_readpe.c index 1bdf8ae37

[Mingw-w64-public] [PATCH 1/2] genidl: Fix detecting of 32-bit and 64-bit PE binaries

2025-05-04 Thread Pali Rohár
Whether PE binary is 32-bit or 64-bit depends on OptionalHeader's Magic which is 0x10b for 32-bit and 0x20b for 64-bit. SizeOfOptionalHeader is not constant, it has just minimal value. --- mingw-w64-tools/genidl/src/genidl_readpe.c | 4 ++-- mingw-w64-tools/genidl/src/genidl_readpe.h | 3 --- 2 f

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

2025-05-04 Thread Pali Rohár
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 them via __MINGW_ASM_CALL() redirection,

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

2025-05-04 Thread Pali Rohár
--- 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/ucrt__snwprintf.c +++ b/mingw-w64-crt/std

[Mingw-w64-public] [PATCH 1/8] crt: Deinline UCRT _swprintf() and _vswprintf() functions and define import symbols for them

2025-05-04 Thread Pali Rohár
This allows to reference _swprintf() and _vswprintf() functions for UCRT build via their symbols, like for msvcrt builds. This change is needed to allow to use __MINGW_ASM_CALL(_swprintf). --- mingw-w64-crt/Makefile.am | 2 ++ mingw-w64-crt/stdio/ucrt__swprintf.c | 21 ++

[Mingw-w64-public] [PATCH 3/8] crt: Deinline UCRT _vsnwprintf() from wchar.h and define import symbol

2025-05-04 Thread Pali Rohár
Function _vsnwprintf() is already deinlined from stdio.h. Do same in wchar.h and define import symbol. --- mingw-w64-crt/stdio/ucrt__vsnwprintf.c | 1 + mingw-w64-headers/crt/wchar.h | 6 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/mingw-w64-crt/stdio/ucrt__vsnw

[Mingw-w64-public] [PATCH 5/8] headers: Deduplicate (v)swprintf, (v)snwprintf _(v)swprintf, _(v)scwprintf functions across UCRT/msvcrt builds

2025-05-04 Thread Pali Rohár
All these functions have same ABI and symbol name in all import libraries. So deduplicate function declarations in stdio.h and wchar.h header files to have just one declaration not depending on the _UCRT macro. --- mingw-w64-headers/crt/stdio.h | 38 +++ mingw-w64-h

[Mingw-w64-public] [PATCH 7/8] crt: Add missing __cdecl for __local_stdio_*_options functions

2025-05-04 Thread Pali Rohár
--- mingw-w64-crt/stdio/ucrt___local_stdio_printf_options.c | 2 +- mingw-w64-crt/stdio/ucrt___local_stdio_scanf_options.c | 2 +- mingw-w64-headers/crt/corecrt_stdio_config.h| 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mingw-w64-crt/stdio/ucrt___local_stdi

[Mingw-w64-public] [PATCH 6/8] headers: Add missing __cdecl for *wscanf functions

2025-05-04 Thread Pali Rohár
--- mingw-w64-headers/crt/stdio.h | 10 +++--- mingw-w64-headers/crt/wchar.h | 11 +++ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/mingw-w64-headers/crt/stdio.h b/mingw-w64-headers/crt/stdio.h index 554a2b913fcd..b21586060a5e 100644 --- a/mingw-w64-headers/crt/stdio

[Mingw-w64-public] [PATCH 2/8] crt: Deinline UCRT _scwprintf() and _vscwprintf() functions and define import symbols for them

2025-05-04 Thread Pali Rohár
This allows to reference _scwprintf() and _vscwprintf() functions for UCRT build via their symbols, like for msvcrt builds. --- mingw-w64-crt/Makefile.am | 2 ++ mingw-w64-crt/stdio/ucrt__scwprintf.c | 21 + mingw-w64-crt/stdio/ucrt__vscwprintf.c | 15 +++