gimp r26420 - in trunk: . app libgimp



Author: tml
Date: Thu Aug  7 15:45:33 2008
New Revision: 26420
URL: http://svn.gnome.org/viewvc/gimp?rev=26420&view=rev

Log:
2008-08-07  Tor Lillqvist  <tml novell com>

	* app/main.c: Code built by the still unstable mingw-w64 toolchain
	gets bogus argc and argv when built as subsystem:windows, so use
	__argc and __argv instead, which seem to be OK.

	* libgimp/gimp.h: Similar change here.



Modified:
   trunk/ChangeLog
   trunk/app/main.c
   trunk/libgimp/gimp.h

Modified: trunk/app/main.c
==============================================================================
--- trunk/app/main.c	(original)
+++ trunk/app/main.c	Thu Aug  7 15:45:33 2008
@@ -278,6 +278,16 @@
   gchar          *basename;
   gint            i;
 
+#if defined (__GNUC__) && defined (_WIN64)
+  /* mingw-w64, at least the unstable build from late July 2008,
+   * starts subsystem:windows programs in main(), but passes them
+   * bogus argc and argv. __argc and __argv are OK, though, so just
+   * use them.
+   */
+  argc = __argc;
+  argv = __argv;
+#endif
+
   g_thread_init (NULL);
 
 #ifdef GIMP_UNSTABLE
@@ -421,7 +431,11 @@
 
 #ifdef G_OS_WIN32
 
-/* In case we build this as a windowed application. Well, we do. */
+/* Provide WinMain in case we build GIMP as a subsystem:windows
+ * application. Well, we do. When built with mingw, though, user code
+ * execution still starts in main() in that case. So WinMain() gets
+ * used on MSVC builds only.
+ */
 
 #ifdef __GNUC__
 #  ifndef _stdcall

Modified: trunk/libgimp/gimp.h
==============================================================================
--- trunk/libgimp/gimp.h	(original)
+++ trunk/libgimp/gimp.h	Thu Aug  7 15:45:33 2008
@@ -199,7 +199,10 @@
    int                                                  \
    main (int argc, char *argv[])                        \
    {                                                    \
-     return gimp_main (&PLUG_IN_INFO, argc, argv);      \
+     /* Use __argc and __argv here, too, as they work   \
+      * better with mingw-w64.				\
+      */						\
+     return gimp_main (&PLUG_IN_INFO, __argc, __argv);  \
    }
 #else
 #  define MAIN()                                        \



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]