app, app-tools: Fix WinMain definition on some executables

Now, it works on both GNU compilers and MSVC.
This commit is contained in:
Bruno Lopes 2025-11-29 15:22:32 -03:00
parent ffcbf8b5dc
commit 897024325d
No known key found for this signature in database
2 changed files with 16 additions and 11 deletions

View file

@ -121,3 +121,14 @@ main (int argc,
exit (EXIT_SUCCESS);
}
#ifdef G_OS_WIN32
int WINAPI
WinMain (HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
return main (__argc, __argv);
}
#endif

View file

@ -918,17 +918,11 @@ main (int argc,
* used on MSVC builds only.
*/
#ifdef __GNUC__
# ifndef _stdcall
# define _stdcall __attribute__((stdcall))
# endif
#endif
int _stdcall
WinMain (struct HINSTANCE__ *hInstance,
struct HINSTANCE__ *hPrevInstance,
char *lpszCmdLine,
int nCmdShow)
int WINAPI
WinMain (HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
return main (__argc, __argv);
}