On Thursday 10 October 2024 15:08:09 Martin Storsjö wrote:
> On Sat, 28 Sep 2024, Pali Rohár wrote:
>
> > msvcr80.dll and msvcr90.dll provides __get_app_type() function which
> > returns the application type set by the __set_app_type() function.
> >
> > UCRT has this symbol named _query_app_type. So add alias into UCRT def
> > files for compatibility.
> > ---
> > mingw-w64-crt/def-include/crt-aliases.def.in | 1 +
> > mingw-w64-crt/include/internal.h | 1 +
> > mingw-w64-crt/lib-common/api-ms-win-crt-runtime-l1-1-0.def.in | 1 +
> > 3 files changed, 3 insertions(+)
>
> Are we sure that these functions have the exact same signature? In many
> cases, when the CRTs have changed function names, it's also when they have
> changed signature and/or some functional aspect.
_query_app_type has:
_crt_app_type __cdecl _query_app_type(void);
where _crt_app_type is defined as:
typedef enum _crt_app_type {
_crt_unknown_app,
_crt_console_app,
_crt_gui_app
} _crt_app_type;
__get_app_type has:
int __cdecl __get_app_type (void);
where return value can be:
#define _CONSOLE_APP 1
#define _GUI_APP 2
So I think that these two functions have same ABI.
Similarly __set_app_type and _set_app_type are:
void __cdecl __set_app_type (int);
void __cdecl _set_app_type(_crt_app_type _Type);
> Other than that, I guess this patch is fine, but is this function even used
> by anything? It's not defined in public headers, and I see no uses of it
> within mingw-w64-crt.
>
> // Martin
Those functions can be used by applications if they provide own
declaration. mingw-w64 has declarations only in internal.h file which is
not installed into public headers. But ucrt variant is available in
public header corecrt_startup.h.
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public