Getting rid of HELPER_CONSOLE define
Submitted by Hans Breuer
Link to original bug (#584282)
Description
To simplify the win32/msvc build of I have patched glib/gspawn-win32-helper.c to always include main() and WinMain() bodies. This way only one object file is needed and the console/windows switch just needs to be done at the link step. Would this change be ok with the mingw build, too?
diff --git a/glib/gspawn-win32-helper.c b/glib/gspawn-win32-helper.c index 40108bb..cf25bb8 100644 --- a/glib/gspawn-win32-helper.c +++ b/glib/gspawn-win32-helper.c @@ -147,16 +147,8 @@ protect_wargv (wchar_t **wargv, return argc; }
-#ifndef HELPER_CONSOLE -int stdcall -WinMain (struct HINSTANCE_ *hInstance,
- struct HINSTANCE__ *hPrevInstance,
- char *lpszCmdLine,
- int nCmdShow) -#else int main (int ignored_argc, char **ignored_argv) -#endif { int child_err_report_fd = -1; int helper_sync_fd = -1; @@ -331,3 +323,13 @@ main (int ignored_argc, char **ignored_argv)
return 0; } + +/* it is not the existence of this function to dediced over console/windows, just one bit set by /subsystem:? */ +int stdcall +WinMain (struct HINSTANCE_ *hInstance,
- struct HINSTANCE__ *hPrevInstance,
- char *lpszCmdLine,
- int nCmdShow) +{
- return main(__argc, __argv); +}
Version: 2.21.x