#define HELPER_CONSOLE in gspawn-win32-helper-console.c
authorTor Lillqvist <tml@novell.com>
Sun, 18 May 2008 21:38:50 +0000 (21:38 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Sun, 18 May 2008 21:38:50 +0000 (21:38 +0000)
2008-05-19  Tor Lillqvist  <tml@novell.com>

* glib/Makefile.am: #define HELPER_CONSOLE in
gspawn-win32-helper-console.c

* glib/gspawn-win32-helper.c: Compile a main() instead of
WinMain() if HELPER_CONSOLE is defined.

svn path=/trunk/; revision=6909

ChangeLog
glib/Makefile.am
glib/gspawn-win32-helper.c

index 43942c56d5210ed168a6ea248c6bdb2998139653..4f94b89d2495b4fc23f11777fe5f2a20ee162fc6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-05-19  Tor Lillqvist  <tml@novell.com>
+
+       * glib/Makefile.am: #define HELPER_CONSOLE in
+       gspawn-win32-helper-console.c
+
+       * glib/gspawn-win32-helper.c: Compile a main() instead of
+       WinMain() if HELPER_CONSOLE is defined.
+
 2008-05-18  Matthias Clasen  <mclasen@redhat.com>
 
        Bug 527214 – g_timer_elapsed() returns random values.
index 2e8b7066b07bda8957b97b67587c5929cdba9c99..24d3bfe349bb058eaca08d827c876b832e404eb5 100644 (file)
@@ -298,7 +298,8 @@ libglib_2_0_la_LDFLAGS = \
 INSTALL_PROGS=
 
 gspawn-win32-helper-console.c:
-       echo '#include "gspawn-win32-helper.c"' >$@
+       echo '#define HELPER_CONSOLE' >$@
+       echo '#include "gspawn-win32-helper.c"' >>$@
 
 if OS_WIN32
 INSTALL_PROGS += gspawn-win32-helper gspawn-win32-helper-console
index 1a717edc266f8eb789ec4e034a3f7ae95ecaaba4..c24f156baeaefb95bdc0c6ad35e1db965e4099f1 100644 (file)
@@ -147,11 +147,16 @@ 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;