GNOME Bugzilla – Bug 584282
Getting rid of HELPER_CONSOLE define
Last modified: 2018-05-24 11:52:22 UTC
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); +}
Sure, I think that will work fine for mingw, too. Thanks. Will commit (together with related makefilery changes) soonish.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/221.