After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 584282 - Getting rid of HELPER_CONSOLE define
Getting rid of HELPER_CONSOLE define
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: win32
2.21.x
Other Windows
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-win32 maintainers
Depends on:
Blocks:
 
 
Reported: 2009-05-30 13:47 UTC by Hans Breuer
Modified: 2018-05-24 11:52 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Hans Breuer 2009-05-30 13:47:50 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);
+}
Comment 1 Tor Lillqvist 2009-05-31 07:53:11 UTC
Sure, I think that will work fine for mingw, too. Thanks. Will commit (together with related makefilery changes) soonish.
Comment 2 GNOME Infrastructure Team 2018-05-24 11:52:22 UTC
-- 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.