From 4af0067274b1076a41b84849fbd5988992ee25f6 Mon Sep 17 00:00:00 2001 From: Bruno Lopes Date: Sat, 29 Nov 2025 15:22:32 -0300 Subject: [PATCH] app, app-tools: Fix WinMain definition on some executables Now, it works on both GNU compilers and MSVC. --- app-tools/gimp-debug-tool.c | 11 +++++++++++ app/main.c | 16 +++++----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/app-tools/gimp-debug-tool.c b/app-tools/gimp-debug-tool.c index cc672ad08b..c6bb16d44b 100644 --- a/app-tools/gimp-debug-tool.c +++ b/app-tools/gimp-debug-tool.c @@ -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 \ No newline at end of file diff --git a/app/main.c b/app/main.c index 4184cb0242..40a6e2fa57 100644 --- a/app/main.c +++ b/app/main.c @@ -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); }