[Mingw-w64-public] [PATCH 2/2] headers: stdio.h: Declare __format__ attribute for _snscanf function

2022-03-05 Thread Pali Rohár
--- mingw-w64-headers/crt/stdio.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mingw-w64-headers/crt/stdio.h b/mingw-w64-headers/crt/stdio.h index dd0f324db2be..76fffa177b10 100644 --- a/mingw-w64-headers/crt/stdio.h +++ b/mingw-w64-headers/crt/stdio.h @@ -732,6 +732,7 @@ int vsnprintf (c

[Mingw-w64-public] [PATCH 1/2] headers: stdio.h: Declare __format__ attribute for _(v)scprintf functions

2022-03-05 Thread Pali Rohár
--- mingw-w64-headers/crt/stdio.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mingw-w64-headers/crt/stdio.h b/mingw-w64-headers/crt/stdio.h index d96f5c96fc65..dd0f324db2be 100644 --- a/mingw-w64-headers/crt/stdio.h +++ b/mingw-w64-headers/crt/stdio.h @@ -721,6 +721,7 @@ int vsnprintf (

[Mingw-w64-public] [PATCH 3/3] headers: inttypes.h: Do not define 64-bit modifiers for crtdll.dll builds

2022-03-05 Thread Pali Rohár
crtdll.dll runtime does not suppport 64-bit printf/scanf modifiers. So when targeting crtdll.dll runtime and not using MinGW-w64 stdio functions then do not define any 64-bit modifier in inttypes.h header file. crtdll.dll does not interpret %I64d modifier and does not read next argument from varia

[Mingw-w64-public] [PATCH 1/3] crt: Add (v)snprintf() support for crtdll.dll builds

2022-03-05 Thread Pali Rohár
MinGW-w64 (v)snprintf() implementation uses windows functions _(v)snprintf() and _(v)scprintf(). Runtime library crtdll.dll provides only _(v)snprintf(), so include MinGW-w64 emulation of _(v)scprintf() functions into libcrtdll.a import library. As header file and __mingw_get_msvcrt_handle() func

[Mingw-w64-public] [PATCH 2/3] headers: _mingw.h: Set __MSVCRT_VERSION__ to 0x00 for crtdll.dll builds

2022-03-05 Thread Pali Rohár
When gcc was compiled with crtdll config then it links binaries with -lcrtdll instead of -lmsvcrt and predefines macro __CRTDLL__. So when __MSVCRT_VERSION__ was not manually set and gcc is not going to use -lmsvcrt then set __MSVCRT_VERSION__ to 0x00 to indicate that msvcrt.dll is not used. ---

Re: [Mingw-w64-public] [PATCH v2 2/2] crt: Fix building lc_locale_func.c for libcrtdll_extra.a

2022-03-05 Thread Martin Storsjö
On Sat, 5 Mar 2022, Pali Rohár wrote: Object files in archive libcrtdll_extra.a (which are linked into import library for crtdll.dll) cannot use msvcrt.h as it tries to load symbols at runtime from msvcrt.dll using GetProcAddress(). So avoid using msvcrt.h and __mingw_get_msvcrt_handle() in crt

[Mingw-w64-public] Need ConvertStringToBSTR and ConvertBSTRToString API for unrar

2022-03-05 Thread Biswapriyo Nath
unrar project needs ConvertStringToBSTR and ConvertBSTRToString APIs which are implemented in comsupp library in MSVC. Can I add those APIs in mingw-w64? Will there be any license/legal issue? ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sou

[Mingw-w64-public] [PATCH v2 2/2] crt: Fix building lc_locale_func.c for libcrtdll_extra.a

2022-03-05 Thread Pali Rohár
Object files in archive libcrtdll_extra.a (which are linked into import library for crtdll.dll) cannot use msvcrt.h as it tries to load symbols at runtime from msvcrt.dll using GetProcAddress(). So avoid using msvcrt.h and __mingw_get_msvcrt_handle() in crtdll.dll runtime and directly use "setloca

[Mingw-w64-public] [PATCH v2 1/2] crt: Add macro __LIBMSVCRT_OS__ for guarding msvcrt.dll

2022-03-05 Thread Pali Rohár
Currently macro __LIBMSVCRT__ is defined when building any libmsvcr*.a import library. But header file msvcrt.h contains inline function __mingw_get_msvcrt_handle() which should be used only from import library for runtime msvcrt.dll (and not for any other runtime msvcr*.dll) as code from that head