]> Pileus Git - ~andy/gtk/commitdiff
Support added for building using a GNU toolchain on Win32,
authorTor Lillqvist <tml@src.gnome.org>
Sun, 25 Apr 1999 21:55:05 +0000 (21:55 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Sun, 25 Apr 1999 21:55:05 +0000 (21:55 +0000)
gcc -mno-cygwin (egcs-1.1.2) on cygwin-b20.1.

* gdk/win32/makefile.cygwin gtk/makefile.cygwin: New files.
* config.h.win32: Changes for gcc.
* gdk/gdkrectangle.c: Include gdk.h as <gdk/gdk.h>.
* gdk/gdkcolor.c: config.h.win32 already defines strcasecmp.
* gdk/win32/gdkconfig.h: Only the MS compiler has wctype.h.
* gdk/win32/gdkdnd.c: Protect (unused) OLE2 stuff better.
Protect shl stuff unavaiilable with mingw32 headers.
* gdk/win32/gdkevents.c: Fix typo.
* gdk/win32/gdkglobals.c: Use GDKVAR here also for gcc.
* gdk/win32/gdkim.c: Use OEM code page for multibyte chars. (?)
* gdk/win32/gdkinput.c: Use __try __except only with the MS compiler.
* gdk/win32/gdkprivate.h: Make up for some stuff missing from
the mingw32 headers.
* gdk/win32/makefile.msc: Use latest Wintab kit and glib.
* gtk/gtkfilesel.c: Include <glib.h> early, to get stat->_stat
definition on Win32. Test for NATIVE_WIN32, not _MSC_VER.
* gtk/gtkfontsel.c: Protect CHARSET redefinition on Win32.
Test for NATIVE_WIN32, not _MSC_VER.
* gtk/gtkmain.c: No use warning about developer version on Win32,
there aren't any non-developer versions anyhow.
* gtk/gtkrc.c: Test for NATIVE_WIN32, not _MSC_VER.
* gtk/makefile.msc: Use pthread from another directory. Minor other
changes.

34 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
README.win32
config.h.win32
gdk/gdkrectangle.c
gdk/win32/gdkcolor-win32.c
gdk/win32/gdkcolor.c
gdk/win32/gdkconfig.h
gdk/win32/gdkdnd-win32.c
gdk/win32/gdkdnd.c
gdk/win32/gdkevents-win32.c
gdk/win32/gdkevents.c
gdk/win32/gdkglobals-win32.c
gdk/win32/gdkglobals.c
gdk/win32/gdkim-win32.c
gdk/win32/gdkim.c
gdk/win32/gdkinput-win32.c
gdk/win32/gdkinput.c
gdk/win32/gdkprivate-win32.h
gdk/win32/gdkprivate.h
gdk/win32/makefile.cygwin [new file with mode: 0644]
gdk/win32/makefile.msc
gtk/gtkfilesel.c
gtk/gtkfontsel.c
gtk/gtkitemfactory.c
gtk/gtkmain.c
gtk/gtkrc.c
gtk/makefile.cygwin [new file with mode: 0644]
gtk/makefile.msc

index 4a78e24cea543092d9c38efd615ff0c25cc10225..a7dd2f78f6b37cafec9c2a7257cd323cd8f2be99 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+1999-04-25  Tor Lillqvist  <tml@iki.fi>
+
+       Support added for building using a GNU toolchain on Win32,
+       gcc -mno-cygwin (egcs-1.1.2) on cygwin-b20.1.
+
+       * gdk/win32/makefile.cygwin gtk/makefile.cygwin: New files.
+       * config.h.win32: Changes for gcc.
+       * gdk/gdkrectangle.c: Include gdk.h as <gdk/gdk.h>.
+       * gdk/gdkcolor.c: config.h.win32 already defines strcasecmp.
+       * gdk/win32/gdkconfig.h: Only the MS compiler has wctype.h.
+       * gdk/win32/gdkdnd.c: Protect (unused) OLE2 stuff better.
+       Protect shl stuff unavaiilable with mingw32 headers.
+       * gdk/win32/gdkevents.c: Fix typo.
+       * gdk/win32/gdkglobals.c: Use GDKVAR here also for gcc.
+       * gdk/win32/gdkim.c: Use OEM code page for multibyte chars. (?)
+       * gdk/win32/gdkinput.c: Use __try __except only with the MS compiler.
+       * gdk/win32/gdkprivate.h: Make up for some stuff missing from
+       the mingw32 headers.
+       * gdk/win32/makefile.msc: Use latest Wintab kit and glib.
+       * gtk/gtkfilesel.c: Include <glib.h> early, to get stat->_stat
+       definition on Win32. Test for NATIVE_WIN32, not _MSC_VER.
+       * gtk/gtkfontsel.c: Protect CHARSET redefinition on Win32.
+       Test for NATIVE_WIN32, not _MSC_VER.
+       * gtk/gtkmain.c: No use warning about developer version on Win32,
+       there aren't any non-developer versions anyhow.
+       * gtk/gtkrc.c: Test for NATIVE_WIN32, not _MSC_VER.
+       * gtk/makefile.msc: Use pthread from another directory. Minor other
+       changes. 
+
 Wed Apr 21 14:20:22 1999  George Lebl  <jirka@5z.com>
 
         * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the
index 4a78e24cea543092d9c38efd615ff0c25cc10225..a7dd2f78f6b37cafec9c2a7257cd323cd8f2be99 100644 (file)
@@ -1,3 +1,32 @@
+1999-04-25  Tor Lillqvist  <tml@iki.fi>
+
+       Support added for building using a GNU toolchain on Win32,
+       gcc -mno-cygwin (egcs-1.1.2) on cygwin-b20.1.
+
+       * gdk/win32/makefile.cygwin gtk/makefile.cygwin: New files.
+       * config.h.win32: Changes for gcc.
+       * gdk/gdkrectangle.c: Include gdk.h as <gdk/gdk.h>.
+       * gdk/gdkcolor.c: config.h.win32 already defines strcasecmp.
+       * gdk/win32/gdkconfig.h: Only the MS compiler has wctype.h.
+       * gdk/win32/gdkdnd.c: Protect (unused) OLE2 stuff better.
+       Protect shl stuff unavaiilable with mingw32 headers.
+       * gdk/win32/gdkevents.c: Fix typo.
+       * gdk/win32/gdkglobals.c: Use GDKVAR here also for gcc.
+       * gdk/win32/gdkim.c: Use OEM code page for multibyte chars. (?)
+       * gdk/win32/gdkinput.c: Use __try __except only with the MS compiler.
+       * gdk/win32/gdkprivate.h: Make up for some stuff missing from
+       the mingw32 headers.
+       * gdk/win32/makefile.msc: Use latest Wintab kit and glib.
+       * gtk/gtkfilesel.c: Include <glib.h> early, to get stat->_stat
+       definition on Win32. Test for NATIVE_WIN32, not _MSC_VER.
+       * gtk/gtkfontsel.c: Protect CHARSET redefinition on Win32.
+       Test for NATIVE_WIN32, not _MSC_VER.
+       * gtk/gtkmain.c: No use warning about developer version on Win32,
+       there aren't any non-developer versions anyhow.
+       * gtk/gtkrc.c: Test for NATIVE_WIN32, not _MSC_VER.
+       * gtk/makefile.msc: Use pthread from another directory. Minor other
+       changes. 
+
 Wed Apr 21 14:20:22 1999  George Lebl  <jirka@5z.com>
 
         * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the
index 4a78e24cea543092d9c38efd615ff0c25cc10225..a7dd2f78f6b37cafec9c2a7257cd323cd8f2be99 100644 (file)
@@ -1,3 +1,32 @@
+1999-04-25  Tor Lillqvist  <tml@iki.fi>
+
+       Support added for building using a GNU toolchain on Win32,
+       gcc -mno-cygwin (egcs-1.1.2) on cygwin-b20.1.
+
+       * gdk/win32/makefile.cygwin gtk/makefile.cygwin: New files.
+       * config.h.win32: Changes for gcc.
+       * gdk/gdkrectangle.c: Include gdk.h as <gdk/gdk.h>.
+       * gdk/gdkcolor.c: config.h.win32 already defines strcasecmp.
+       * gdk/win32/gdkconfig.h: Only the MS compiler has wctype.h.
+       * gdk/win32/gdkdnd.c: Protect (unused) OLE2 stuff better.
+       Protect shl stuff unavaiilable with mingw32 headers.
+       * gdk/win32/gdkevents.c: Fix typo.
+       * gdk/win32/gdkglobals.c: Use GDKVAR here also for gcc.
+       * gdk/win32/gdkim.c: Use OEM code page for multibyte chars. (?)
+       * gdk/win32/gdkinput.c: Use __try __except only with the MS compiler.
+       * gdk/win32/gdkprivate.h: Make up for some stuff missing from
+       the mingw32 headers.
+       * gdk/win32/makefile.msc: Use latest Wintab kit and glib.
+       * gtk/gtkfilesel.c: Include <glib.h> early, to get stat->_stat
+       definition on Win32. Test for NATIVE_WIN32, not _MSC_VER.
+       * gtk/gtkfontsel.c: Protect CHARSET redefinition on Win32.
+       Test for NATIVE_WIN32, not _MSC_VER.
+       * gtk/gtkmain.c: No use warning about developer version on Win32,
+       there aren't any non-developer versions anyhow.
+       * gtk/gtkrc.c: Test for NATIVE_WIN32, not _MSC_VER.
+       * gtk/makefile.msc: Use pthread from another directory. Minor other
+       changes. 
+
 Wed Apr 21 14:20:22 1999  George Lebl  <jirka@5z.com>
 
         * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the
index 4a78e24cea543092d9c38efd615ff0c25cc10225..a7dd2f78f6b37cafec9c2a7257cd323cd8f2be99 100644 (file)
@@ -1,3 +1,32 @@
+1999-04-25  Tor Lillqvist  <tml@iki.fi>
+
+       Support added for building using a GNU toolchain on Win32,
+       gcc -mno-cygwin (egcs-1.1.2) on cygwin-b20.1.
+
+       * gdk/win32/makefile.cygwin gtk/makefile.cygwin: New files.
+       * config.h.win32: Changes for gcc.
+       * gdk/gdkrectangle.c: Include gdk.h as <gdk/gdk.h>.
+       * gdk/gdkcolor.c: config.h.win32 already defines strcasecmp.
+       * gdk/win32/gdkconfig.h: Only the MS compiler has wctype.h.
+       * gdk/win32/gdkdnd.c: Protect (unused) OLE2 stuff better.
+       Protect shl stuff unavaiilable with mingw32 headers.
+       * gdk/win32/gdkevents.c: Fix typo.
+       * gdk/win32/gdkglobals.c: Use GDKVAR here also for gcc.
+       * gdk/win32/gdkim.c: Use OEM code page for multibyte chars. (?)
+       * gdk/win32/gdkinput.c: Use __try __except only with the MS compiler.
+       * gdk/win32/gdkprivate.h: Make up for some stuff missing from
+       the mingw32 headers.
+       * gdk/win32/makefile.msc: Use latest Wintab kit and glib.
+       * gtk/gtkfilesel.c: Include <glib.h> early, to get stat->_stat
+       definition on Win32. Test for NATIVE_WIN32, not _MSC_VER.
+       * gtk/gtkfontsel.c: Protect CHARSET redefinition on Win32.
+       Test for NATIVE_WIN32, not _MSC_VER.
+       * gtk/gtkmain.c: No use warning about developer version on Win32,
+       there aren't any non-developer versions anyhow.
+       * gtk/gtkrc.c: Test for NATIVE_WIN32, not _MSC_VER.
+       * gtk/makefile.msc: Use pthread from another directory. Minor other
+       changes. 
+
 Wed Apr 21 14:20:22 1999  George Lebl  <jirka@5z.com>
 
         * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the
index 4a78e24cea543092d9c38efd615ff0c25cc10225..a7dd2f78f6b37cafec9c2a7257cd323cd8f2be99 100644 (file)
@@ -1,3 +1,32 @@
+1999-04-25  Tor Lillqvist  <tml@iki.fi>
+
+       Support added for building using a GNU toolchain on Win32,
+       gcc -mno-cygwin (egcs-1.1.2) on cygwin-b20.1.
+
+       * gdk/win32/makefile.cygwin gtk/makefile.cygwin: New files.
+       * config.h.win32: Changes for gcc.
+       * gdk/gdkrectangle.c: Include gdk.h as <gdk/gdk.h>.
+       * gdk/gdkcolor.c: config.h.win32 already defines strcasecmp.
+       * gdk/win32/gdkconfig.h: Only the MS compiler has wctype.h.
+       * gdk/win32/gdkdnd.c: Protect (unused) OLE2 stuff better.
+       Protect shl stuff unavaiilable with mingw32 headers.
+       * gdk/win32/gdkevents.c: Fix typo.
+       * gdk/win32/gdkglobals.c: Use GDKVAR here also for gcc.
+       * gdk/win32/gdkim.c: Use OEM code page for multibyte chars. (?)
+       * gdk/win32/gdkinput.c: Use __try __except only with the MS compiler.
+       * gdk/win32/gdkprivate.h: Make up for some stuff missing from
+       the mingw32 headers.
+       * gdk/win32/makefile.msc: Use latest Wintab kit and glib.
+       * gtk/gtkfilesel.c: Include <glib.h> early, to get stat->_stat
+       definition on Win32. Test for NATIVE_WIN32, not _MSC_VER.
+       * gtk/gtkfontsel.c: Protect CHARSET redefinition on Win32.
+       Test for NATIVE_WIN32, not _MSC_VER.
+       * gtk/gtkmain.c: No use warning about developer version on Win32,
+       there aren't any non-developer versions anyhow.
+       * gtk/gtkrc.c: Test for NATIVE_WIN32, not _MSC_VER.
+       * gtk/makefile.msc: Use pthread from another directory. Minor other
+       changes. 
+
 Wed Apr 21 14:20:22 1999  George Lebl  <jirka@5z.com>
 
         * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the
index 4a78e24cea543092d9c38efd615ff0c25cc10225..a7dd2f78f6b37cafec9c2a7257cd323cd8f2be99 100644 (file)
@@ -1,3 +1,32 @@
+1999-04-25  Tor Lillqvist  <tml@iki.fi>
+
+       Support added for building using a GNU toolchain on Win32,
+       gcc -mno-cygwin (egcs-1.1.2) on cygwin-b20.1.
+
+       * gdk/win32/makefile.cygwin gtk/makefile.cygwin: New files.
+       * config.h.win32: Changes for gcc.
+       * gdk/gdkrectangle.c: Include gdk.h as <gdk/gdk.h>.
+       * gdk/gdkcolor.c: config.h.win32 already defines strcasecmp.
+       * gdk/win32/gdkconfig.h: Only the MS compiler has wctype.h.
+       * gdk/win32/gdkdnd.c: Protect (unused) OLE2 stuff better.
+       Protect shl stuff unavaiilable with mingw32 headers.
+       * gdk/win32/gdkevents.c: Fix typo.
+       * gdk/win32/gdkglobals.c: Use GDKVAR here also for gcc.
+       * gdk/win32/gdkim.c: Use OEM code page for multibyte chars. (?)
+       * gdk/win32/gdkinput.c: Use __try __except only with the MS compiler.
+       * gdk/win32/gdkprivate.h: Make up for some stuff missing from
+       the mingw32 headers.
+       * gdk/win32/makefile.msc: Use latest Wintab kit and glib.
+       * gtk/gtkfilesel.c: Include <glib.h> early, to get stat->_stat
+       definition on Win32. Test for NATIVE_WIN32, not _MSC_VER.
+       * gtk/gtkfontsel.c: Protect CHARSET redefinition on Win32.
+       Test for NATIVE_WIN32, not _MSC_VER.
+       * gtk/gtkmain.c: No use warning about developer version on Win32,
+       there aren't any non-developer versions anyhow.
+       * gtk/gtkrc.c: Test for NATIVE_WIN32, not _MSC_VER.
+       * gtk/makefile.msc: Use pthread from another directory. Minor other
+       changes. 
+
 Wed Apr 21 14:20:22 1999  George Lebl  <jirka@5z.com>
 
         * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the
index 4a78e24cea543092d9c38efd615ff0c25cc10225..a7dd2f78f6b37cafec9c2a7257cd323cd8f2be99 100644 (file)
@@ -1,3 +1,32 @@
+1999-04-25  Tor Lillqvist  <tml@iki.fi>
+
+       Support added for building using a GNU toolchain on Win32,
+       gcc -mno-cygwin (egcs-1.1.2) on cygwin-b20.1.
+
+       * gdk/win32/makefile.cygwin gtk/makefile.cygwin: New files.
+       * config.h.win32: Changes for gcc.
+       * gdk/gdkrectangle.c: Include gdk.h as <gdk/gdk.h>.
+       * gdk/gdkcolor.c: config.h.win32 already defines strcasecmp.
+       * gdk/win32/gdkconfig.h: Only the MS compiler has wctype.h.
+       * gdk/win32/gdkdnd.c: Protect (unused) OLE2 stuff better.
+       Protect shl stuff unavaiilable with mingw32 headers.
+       * gdk/win32/gdkevents.c: Fix typo.
+       * gdk/win32/gdkglobals.c: Use GDKVAR here also for gcc.
+       * gdk/win32/gdkim.c: Use OEM code page for multibyte chars. (?)
+       * gdk/win32/gdkinput.c: Use __try __except only with the MS compiler.
+       * gdk/win32/gdkprivate.h: Make up for some stuff missing from
+       the mingw32 headers.
+       * gdk/win32/makefile.msc: Use latest Wintab kit and glib.
+       * gtk/gtkfilesel.c: Include <glib.h> early, to get stat->_stat
+       definition on Win32. Test for NATIVE_WIN32, not _MSC_VER.
+       * gtk/gtkfontsel.c: Protect CHARSET redefinition on Win32.
+       Test for NATIVE_WIN32, not _MSC_VER.
+       * gtk/gtkmain.c: No use warning about developer version on Win32,
+       there aren't any non-developer versions anyhow.
+       * gtk/gtkrc.c: Test for NATIVE_WIN32, not _MSC_VER.
+       * gtk/makefile.msc: Use pthread from another directory. Minor other
+       changes. 
+
 Wed Apr 21 14:20:22 1999  George Lebl  <jirka@5z.com>
 
         * gdk/gdkwindow.c: (gdk_window_remove_filter) correctly remove the
index cdf266d25cf1ef350da17cca9211fbb54611c05f..a0f433e0de67a26c97a782809ef976f949df38a3 100644 (file)
@@ -3,12 +3,15 @@ correct as the Unix/X11 version. For more information about the Win32
 port, see http://www.gimp.org/tml/gimp/win32/ or
 http://www.iki.fi/tml/gimp/win32/ .
 
-As for now, only Microsoft C (the command-line compiler) is
-supported. Before compiling, check the BIN definition in
-gdk\win32\makefile.msc and gtk\makefile.msc. Compile in gdk\win32 and
-gtk with `nmake -f makefile.msc`. Install with `nmake -f makefile.msc
-install`. Cygwin ("mingw32", i.e. gcc -mno-cygwin) support will be
-added later.
+To build GTk+ on Win32, you need either Microsoft compiler and tools,
+or egcs-1.1.2 running under cygwin-b20.1. Before compiling, check the
+BIN definition in gdk\win32\makefile.msc (or makefile.cygwin) and
+gtk\makefile.msc (or makefile.cygwin). Compile in gdk\win32 and gtk
+with `nmake -f makefile.msc` or `make -f makefile.cygwin`.
+
+See the README.win32 file in the GLib distribution for preparations to
+build with egcs on cygwin.
 
 The tablet support uses the Wintab API. The Wintab development kit can
 be downloaded from http://www.pointing.com.
+
index 77a8137bd0548fe6b4f00784975267bbfa2b7456..6bfa081383c8a6e057ee29a16d254ad932db4255 100755 (executable)
@@ -1,6 +1,6 @@
 /* config.h.win32.  Handcrafted for Microsoft C */
 
-#ifndef _MSC_VER
+#if ! (defined(_MSC_VER) || defined(__GNUC__))
 #error Unrecognized Win32 compiler, edit config.h.win32 by hand
 #endif
 
 
 /* Define if you have alloca, as a function or macro.  */
 #define HAVE_ALLOCA 1
+#ifdef _MSC_VER
 #define alloca _alloca
+#elif defined (__GNUC__)
+#define alloca __builtin_alloca
+#endif
 
 /* Define if you have <alloca.h> and it should be used (not on Ultrix).  */
 /* #undef HAVE_ALLOCA_H */
 
 /* Define if you have the strcasecmp function.  */
 #define HAVE_STRCASECMP 1
-#define strcasecmp stricmp
+#define strcasecmp _stricmp
 
 /* Define if you have the strchr function.  */
 #define HAVE_STRCHR 1
 #define HAVE_WCHAR_H 1
 
 /* Define if you have the <wctype.h> header file.  */
+#ifdef _MSC_VER
 #define HAVE_WCTYPE_H 1
+#endif /* _MSC_VER */
 
 /* Define if you have the i library (-li).  */
 /* #undef HAVE_LIBI */
index 8fd435aa9e9d17b8a1d5a13742e2040e5bec90a0..3eeb540ff8a11a8ffe5970e18e9827e7471f905f 100644 (file)
@@ -24,7 +24,7 @@
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  */
 
-#include "gdk.h"
+#include <gdk/gdk.h>
 
 
 
index 06273d3be4013013fe481c9d721ead86ce564663..2581e317f10119e73ea44216b4682ea6226e6086 100644 (file)
 
 #include "gdkx.h"
 
-#ifdef _MSC_VER
-#define strcasecmp stricmp
-#endif
-
 static gint  gdk_colormap_match_color (GdkColormap *cmap,
                                       GdkColor    *color,
                                       const gchar *available);
index 06273d3be4013013fe481c9d721ead86ce564663..2581e317f10119e73ea44216b4682ea6226e6086 100644 (file)
 
 #include "gdkx.h"
 
-#ifdef _MSC_VER
-#define strcasecmp stricmp
-#endif
-
 static gint  gdk_colormap_match_color (GdkColormap *cmap,
                                       GdkColor    *color,
                                       const gchar *available);
index 50282083753c4a95e4be1019bc4b62ad0a4ea970..e002349e95340a593cbde8eee8bbb80125de89df 100644 (file)
@@ -2,4 +2,6 @@
 
 #define GDK_WINDOWING GDK_WINDOWING_WIN32
 #define GDK_HAVE_WCHAR_H 1
+#ifdef _MSC_VER
 #define GDK_HAVE_WCTYPE_H 1
+#endif
index 316d411b982b4c6313c19b8408d210c1c5780a9b..4ea435441ed3cef95b8e0d63d9968a2f47fee8af 100644 (file)
 
 #include <string.h>
 
+#ifdef OLE2_DND
 #include <ole2.h>
+#endif
+
+#ifdef _MSC_VER
 #include <shlobj.h>
 #include <shlguid.h>
+#endif
 
 #include <gdk/gdk.h>
 #include "gdkx.h"
@@ -143,7 +148,7 @@ gdk_drag_context_new        (void)
   return (GdkDragContext *)result;
 }
 
-#if OLE2_DND
+#ifdef OLE2_DND
 
 typedef struct {
   IDropTarget idt;
@@ -265,7 +270,7 @@ m_drop (IDropTarget __RPC_FAR *This,
   GDK_NOTE (DND, g_print ("m_drop\n"));
   return E_UNEXPECTED;
 }
+
 HRESULT STDMETHODCALLTYPE
 m_query_interface_source (IDropSource __RPC_FAR *This,
                          /* [in] */ REFIID riid,
@@ -408,7 +413,7 @@ source_context_new (void)
 
 #endif /* OLE2_DND */
 
-void            
+void
 gdk_drag_context_ref (GdkDragContext *context)
 {
   g_return_if_fail (context != NULL);
@@ -416,7 +421,7 @@ gdk_drag_context_ref (GdkDragContext *context)
   ((GdkDragContextPrivate *)context)->ref_count++;
 }
 
-void            
+void
 gdk_drag_context_unref (GdkDragContext *context)
 {
   GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
@@ -475,6 +480,8 @@ gdk_drag_context_find (gboolean is_source,
 
 #endif
 
+#ifdef _MSC_VER
+
 /* From MS Knowledge Base article Q130698 */
 
 /* resolve_link() fills the filename and path buffer
@@ -564,6 +571,12 @@ resolve_link(HWND hWnd,
   return SUCCEEDED (hres);
 }
 
+#else
+
+#define resolve_link(hWnd, lpszLinkName, lpszPath, lpszDescription) FALSE
+
+#endif
+
 static GdkFilterReturn
 gdk_dropfiles_filter (GdkXEvent *xev,
                      GdkEvent  *event,
@@ -642,7 +655,6 @@ gdk_dropfiles_filter (GdkXEvent *xev,
   else
     return GDK_FILTER_CONTINUE;
 }
-                    
 
 /*************************************************************
  ************************** Public API ***********************
@@ -652,17 +664,20 @@ void
 gdk_dnd_init (void)
 {
   HRESULT hres;
-
+#ifdef OLE2_DND
   hres = OleInitialize (NULL);
 
   if (! SUCCEEDED (hres))
     g_error ("OleInitialize failed");
-}                    
+#endif
+}      
 
 void
 gdk_dnd_exit (void)
 {
+#ifdef OLE2_DND
   OleUninitialize ();
+#endif
 }
 
 /* Source side */
@@ -747,7 +762,7 @@ gdk_drag_find_window (GdkDragContext  *context,
     }
 }
 
-gboolean        
+gboolean
 gdk_drag_motion (GdkDragContext *context,
                 GdkWindow      *dest_window,
                 GdkDragProtocol protocol,
@@ -780,7 +795,7 @@ gdk_drag_abort (GdkDragContext *context,
 
 /* Destination side */
 
-void             
+void
 gdk_drag_status (GdkDragContext   *context,
                 GdkDragAction     action,
                 guint32           time)
@@ -795,19 +810,18 @@ gdk_drop_reply (GdkDragContext   *context,
 {
 }
 
-void             
+void
 gdk_drop_finish (GdkDragContext   *context,
                 gboolean          success,
                 guint32           time)
 {
 }
 
-
-void            
+void
 gdk_window_register_dnd (GdkWindow      *window)
 {
   GdkWindowPrivate *private = (GdkWindowPrivate *) window;
-#if OLE2_DND
+#ifdef OLE2_DND
   target_drag_context *context;
   HRESULT hres;
 #endif
@@ -824,7 +838,7 @@ gdk_window_register_dnd (GdkWindow      *window)
   gdk_window_add_filter (window, gdk_dropfiles_filter, NULL);
   DragAcceptFiles (private->xwindow, TRUE);
 
-#if OLE2_DND
+#ifdef OLE2_DND
   /* Register for OLE2 d&d */
   context = target_context_new ();
   hres = CoLockObjectExternal ((IUnknown *) &context->idt, TRUE, FALSE);
@@ -848,11 +862,11 @@ gdk_window_register_dnd (GdkWindow      *window)
  * gdk_drag_get_selection:
  *     Returns the selection atom for the current source window
  *   arguments:
- *     
+ *
  *   results:
  *************************************************************/
 
-GdkAtom       
+GdkAtom
 gdk_drag_get_selection (GdkDragContext *context)
 {
   if (context->protocol == GDK_DRAG_PROTO_WIN32_DROPFILES)
index 316d411b982b4c6313c19b8408d210c1c5780a9b..4ea435441ed3cef95b8e0d63d9968a2f47fee8af 100644 (file)
 
 #include <string.h>
 
+#ifdef OLE2_DND
 #include <ole2.h>
+#endif
+
+#ifdef _MSC_VER
 #include <shlobj.h>
 #include <shlguid.h>
+#endif
 
 #include <gdk/gdk.h>
 #include "gdkx.h"
@@ -143,7 +148,7 @@ gdk_drag_context_new        (void)
   return (GdkDragContext *)result;
 }
 
-#if OLE2_DND
+#ifdef OLE2_DND
 
 typedef struct {
   IDropTarget idt;
@@ -265,7 +270,7 @@ m_drop (IDropTarget __RPC_FAR *This,
   GDK_NOTE (DND, g_print ("m_drop\n"));
   return E_UNEXPECTED;
 }
+
 HRESULT STDMETHODCALLTYPE
 m_query_interface_source (IDropSource __RPC_FAR *This,
                          /* [in] */ REFIID riid,
@@ -408,7 +413,7 @@ source_context_new (void)
 
 #endif /* OLE2_DND */
 
-void            
+void
 gdk_drag_context_ref (GdkDragContext *context)
 {
   g_return_if_fail (context != NULL);
@@ -416,7 +421,7 @@ gdk_drag_context_ref (GdkDragContext *context)
   ((GdkDragContextPrivate *)context)->ref_count++;
 }
 
-void            
+void
 gdk_drag_context_unref (GdkDragContext *context)
 {
   GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
@@ -475,6 +480,8 @@ gdk_drag_context_find (gboolean is_source,
 
 #endif
 
+#ifdef _MSC_VER
+
 /* From MS Knowledge Base article Q130698 */
 
 /* resolve_link() fills the filename and path buffer
@@ -564,6 +571,12 @@ resolve_link(HWND hWnd,
   return SUCCEEDED (hres);
 }
 
+#else
+
+#define resolve_link(hWnd, lpszLinkName, lpszPath, lpszDescription) FALSE
+
+#endif
+
 static GdkFilterReturn
 gdk_dropfiles_filter (GdkXEvent *xev,
                      GdkEvent  *event,
@@ -642,7 +655,6 @@ gdk_dropfiles_filter (GdkXEvent *xev,
   else
     return GDK_FILTER_CONTINUE;
 }
-                    
 
 /*************************************************************
  ************************** Public API ***********************
@@ -652,17 +664,20 @@ void
 gdk_dnd_init (void)
 {
   HRESULT hres;
-
+#ifdef OLE2_DND
   hres = OleInitialize (NULL);
 
   if (! SUCCEEDED (hres))
     g_error ("OleInitialize failed");
-}                    
+#endif
+}      
 
 void
 gdk_dnd_exit (void)
 {
+#ifdef OLE2_DND
   OleUninitialize ();
+#endif
 }
 
 /* Source side */
@@ -747,7 +762,7 @@ gdk_drag_find_window (GdkDragContext  *context,
     }
 }
 
-gboolean        
+gboolean
 gdk_drag_motion (GdkDragContext *context,
                 GdkWindow      *dest_window,
                 GdkDragProtocol protocol,
@@ -780,7 +795,7 @@ gdk_drag_abort (GdkDragContext *context,
 
 /* Destination side */
 
-void             
+void
 gdk_drag_status (GdkDragContext   *context,
                 GdkDragAction     action,
                 guint32           time)
@@ -795,19 +810,18 @@ gdk_drop_reply (GdkDragContext   *context,
 {
 }
 
-void             
+void
 gdk_drop_finish (GdkDragContext   *context,
                 gboolean          success,
                 guint32           time)
 {
 }
 
-
-void            
+void
 gdk_window_register_dnd (GdkWindow      *window)
 {
   GdkWindowPrivate *private = (GdkWindowPrivate *) window;
-#if OLE2_DND
+#ifdef OLE2_DND
   target_drag_context *context;
   HRESULT hres;
 #endif
@@ -824,7 +838,7 @@ gdk_window_register_dnd (GdkWindow      *window)
   gdk_window_add_filter (window, gdk_dropfiles_filter, NULL);
   DragAcceptFiles (private->xwindow, TRUE);
 
-#if OLE2_DND
+#ifdef OLE2_DND
   /* Register for OLE2 d&d */
   context = target_context_new ();
   hres = CoLockObjectExternal ((IUnknown *) &context->idt, TRUE, FALSE);
@@ -848,11 +862,11 @@ gdk_window_register_dnd (GdkWindow      *window)
  * gdk_drag_get_selection:
  *     Returns the selection atom for the current source window
  *   arguments:
- *     
+ *
  *   results:
  *************************************************************/
 
-GdkAtom       
+GdkAtom
 gdk_drag_get_selection (GdkDragContext *context)
 {
   if (context->protocol == GDK_DRAG_PROTO_WIN32_DROPFILES)
index 461d3a553864e2a70c5e9b13abe9df4afde3fde9..fa839fe898b18c70d2b7fa5b62ffe0f4ff6e749d 100644 (file)
@@ -1547,7 +1547,7 @@ gdk_event_translate (GdkEvent *event,
 
       is_AltGr_key = FALSE;
       event->key.type = ((xevent->message == WM_KEYDOWN
-                         | xevent->message == WM_SYSKEYDOWN) ?
+                         || xevent->message == WM_SYSKEYDOWN) ?
                         GDK_KEY_PRESS : GDK_KEY_RELEASE);
       event->key.window = window;
       event->key.time = xevent->time;
index 461d3a553864e2a70c5e9b13abe9df4afde3fde9..fa839fe898b18c70d2b7fa5b62ffe0f4ff6e749d 100644 (file)
@@ -1547,7 +1547,7 @@ gdk_event_translate (GdkEvent *event,
 
       is_AltGr_key = FALSE;
       event->key.type = ((xevent->message == WM_KEYDOWN
-                         | xevent->message == WM_SYSKEYDOWN) ?
+                         || xevent->message == WM_SYSKEYDOWN) ?
                         GDK_KEY_PRESS : GDK_KEY_RELEASE);
       event->key.window = window;
       event->key.time = xevent->time;
index f96b092b711b346b453e585e2bd6183198768e32..0bb58269450feba1a0af62f214c47cb727e57af4 100644 (file)
@@ -31,7 +31,7 @@
 guint             gdk_debug_flags = 0;
 HWND              gdk_root_window;
 HWND              gdk_leader_window;
-GdkWindowPrivate  gdk_root_parent = { { NULL, }, NULL, };
+GDKVAR GdkWindowPrivate  gdk_root_parent = { { NULL, }, NULL, };
 HDC              gdk_DC;
 HINSTANCE        gdk_DLLInstance;
 HINSTANCE        gdk_ProgInstance;
index f96b092b711b346b453e585e2bd6183198768e32..0bb58269450feba1a0af62f214c47cb727e57af4 100644 (file)
@@ -31,7 +31,7 @@
 guint             gdk_debug_flags = 0;
 HWND              gdk_root_window;
 HWND              gdk_leader_window;
-GdkWindowPrivate  gdk_root_parent = { { NULL, }, NULL, };
+GDKVAR GdkWindowPrivate  gdk_root_parent = { { NULL, }, NULL, };
 HDC              gdk_DC;
 HINSTANCE        gdk_DLLInstance;
 HINSTANCE        gdk_ProgInstance;
index 8b49733f6ad2c30258d939162997a3e4d2287dbe..caeafe53ab8d3a7a20ff2ad078daa433ba1559fa 100644 (file)
 
 #if HAVE_CONFIG_H
 #  include <config.h>
-#  if STDC_HEADERS
-#    include <string.h>
-#  endif
 #endif
 
+#include <stdlib.h>
+#include <string.h>
+
 #include <gdk/gdk.h>
 #include <gdk/gdki18n.h>
 #include "gdkx.h"
@@ -172,10 +172,10 @@ gdk_wcstombs (const GdkWChar *src)
       src_alt = g_new (wchar_t, wcsl+1);
       for (i = wcsl; i >= 0; i--)
        src_alt[i] = src[i];
-      mbsl = WideCharToMultiByte (CP_ACP, 0, src_alt, wcsl,
+      mbsl = WideCharToMultiByte (CP_OEMCP, 0, src_alt, wcsl,
                                  NULL, 0, NULL, NULL);
       mbstr = g_new (guchar, mbsl + 1);
-      if (!WideCharToMultiByte (CP_ACP, 0, src_alt, wcsl,
+      if (!WideCharToMultiByte (CP_OEMCP, 0, src_alt, wcsl,
                                mbstr, mbsl, NULL, NULL))
        {
          g_warning ("gdk_wcstombs: WideCharToMultiByte failed");
@@ -219,9 +219,9 @@ gdk_mbstowcs (GdkWChar *dest, const gchar *src, gint dest_max)
       gint i, wcsl;
       wchar_t *wcstr;
 
-      wcsl = MultiByteToWideChar (CP_ACP, 0, src, -1, NULL, 0);
-      wcstr = g_new (wchar_t, wcsl + 1);
-      if (!MultiByteToWideChar (CP_ACP, 0, src, -1, wcstr, wcsl))
+      wcsl = MultiByteToWideChar (CP_OEMCP, 0, src, -1, NULL, 0);
+      wcstr = g_new (wchar_t, wcsl);
+      if (!MultiByteToWideChar (CP_OEMCP, 0, src, -1, wcstr, wcsl))
        {
          g_warning ("gdk_mbstowcs: MultiByteToWideChar failed");
          g_free (wcstr);
@@ -229,11 +229,11 @@ gdk_mbstowcs (GdkWChar *dest, const gchar *src, gint dest_max)
        }
       if (wcsl > dest_max)
        wcsl = dest_max;
-      for (i = 0; i < wcsl; i++)
+      for (i = 0; i < wcsl && wcstr[i]; i++)
        dest[i] = wcstr[i];
       g_free (wcstr);
 
-      return wcsl;
+      return i;
     }
   else
     {
index 8b49733f6ad2c30258d939162997a3e4d2287dbe..caeafe53ab8d3a7a20ff2ad078daa433ba1559fa 100644 (file)
 
 #if HAVE_CONFIG_H
 #  include <config.h>
-#  if STDC_HEADERS
-#    include <string.h>
-#  endif
 #endif
 
+#include <stdlib.h>
+#include <string.h>
+
 #include <gdk/gdk.h>
 #include <gdk/gdki18n.h>
 #include "gdkx.h"
@@ -172,10 +172,10 @@ gdk_wcstombs (const GdkWChar *src)
       src_alt = g_new (wchar_t, wcsl+1);
       for (i = wcsl; i >= 0; i--)
        src_alt[i] = src[i];
-      mbsl = WideCharToMultiByte (CP_ACP, 0, src_alt, wcsl,
+      mbsl = WideCharToMultiByte (CP_OEMCP, 0, src_alt, wcsl,
                                  NULL, 0, NULL, NULL);
       mbstr = g_new (guchar, mbsl + 1);
-      if (!WideCharToMultiByte (CP_ACP, 0, src_alt, wcsl,
+      if (!WideCharToMultiByte (CP_OEMCP, 0, src_alt, wcsl,
                                mbstr, mbsl, NULL, NULL))
        {
          g_warning ("gdk_wcstombs: WideCharToMultiByte failed");
@@ -219,9 +219,9 @@ gdk_mbstowcs (GdkWChar *dest, const gchar *src, gint dest_max)
       gint i, wcsl;
       wchar_t *wcstr;
 
-      wcsl = MultiByteToWideChar (CP_ACP, 0, src, -1, NULL, 0);
-      wcstr = g_new (wchar_t, wcsl + 1);
-      if (!MultiByteToWideChar (CP_ACP, 0, src, -1, wcstr, wcsl))
+      wcsl = MultiByteToWideChar (CP_OEMCP, 0, src, -1, NULL, 0);
+      wcstr = g_new (wchar_t, wcsl);
+      if (!MultiByteToWideChar (CP_OEMCP, 0, src, -1, wcstr, wcsl))
        {
          g_warning ("gdk_mbstowcs: MultiByteToWideChar failed");
          g_free (wcstr);
@@ -229,11 +229,11 @@ gdk_mbstowcs (GdkWChar *dest, const gchar *src, gint dest_max)
        }
       if (wcsl > dest_max)
        wcsl = dest_max;
-      for (i = 0; i < wcsl; i++)
+      for (i = 0; i < wcsl && wcstr[i]; i++)
        dest[i] = wcstr[i];
       g_free (wcstr);
 
-      return wcsl;
+      return i;
     }
   else
     {
index e6369c73e4d42205a9e7868c50ddf7421352cddc..70063a7a724841b35d1164495a07543ec321e943 100644 (file)
@@ -1460,20 +1460,24 @@ gdk_input_exit (void)
       HCTX *hctx = (HCTX *) tmp_list->data;
       BOOL result;
 
+#ifdef _MSC_VER
       /* For some reason WTEnable and/or WTClose tend to crash here.
        * Protect with __try/__except to avoid a message box.
        */
       __try {
+#endif /* _MSC_VER */
 #if 0
         WTEnable (*hctx, FALSE);
 #endif
        result = WTClose (*hctx);
+#ifdef _MSC_VER
       }
       __except (/* GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ? */
                 EXCEPTION_EXECUTE_HANDLER /*: 
                 EXCEPTION_CONTINUE_SEARCH */) {
        result = FALSE;
       }
+#endif /* _MSC_VER */
       if (!result)
        g_warning ("gdk_input_exit: Closing Wintab context %#x failed", *hctx);
       g_free (hctx);
index e6369c73e4d42205a9e7868c50ddf7421352cddc..70063a7a724841b35d1164495a07543ec321e943 100644 (file)
@@ -1460,20 +1460,24 @@ gdk_input_exit (void)
       HCTX *hctx = (HCTX *) tmp_list->data;
       BOOL result;
 
+#ifdef _MSC_VER
       /* For some reason WTEnable and/or WTClose tend to crash here.
        * Protect with __try/__except to avoid a message box.
        */
       __try {
+#endif /* _MSC_VER */
 #if 0
         WTEnable (*hctx, FALSE);
 #endif
        result = WTClose (*hctx);
+#ifdef _MSC_VER
       }
       __except (/* GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ? */
                 EXCEPTION_EXECUTE_HANDLER /*: 
                 EXCEPTION_CONTINUE_SEARCH */) {
        result = FALSE;
       }
+#endif /* _MSC_VER */
       if (!result)
        g_warning ("gdk_input_exit: Closing Wintab context %#x failed", *hctx);
       g_free (hctx);
index d281b3ed878a438b56e1992544ddf105c49a2c55..20b301bf42d6a139eaa629806e193b2a787a2672 100644 (file)
 #define STRICT                 /* We want strict type checks */
 #include <windows.h>
 
+/* Make up for some minor mingw32 lossage */
+
+/* PS_JOIN_MASK is missing from the mingw32 headers */
+#ifndef PS_JOIN_MASK
+#define PS_JOIN_MASK (PS_JOIN_BEVEL|PS_JOIN_MITER|PS_JOIN_ROUND)
+#endif
+
+/* CLR_INVALID is missing */
+#ifndef CLR_INVALID
+#define CLR_INVALID CLR_NONE
+#endif
+
+/* MB_CUR_MAX is missing */
+#ifndef MB_CUR_MAX
+extern int *__imp___mb_cur_max;
+#define MB_CUR_MAX (*__imp___mb_cur_max)
+#endif
+
 #include <time.h>
 #include <gdk/gdktypes.h>
 
index d281b3ed878a438b56e1992544ddf105c49a2c55..20b301bf42d6a139eaa629806e193b2a787a2672 100644 (file)
 #define STRICT                 /* We want strict type checks */
 #include <windows.h>
 
+/* Make up for some minor mingw32 lossage */
+
+/* PS_JOIN_MASK is missing from the mingw32 headers */
+#ifndef PS_JOIN_MASK
+#define PS_JOIN_MASK (PS_JOIN_BEVEL|PS_JOIN_MITER|PS_JOIN_ROUND)
+#endif
+
+/* CLR_INVALID is missing */
+#ifndef CLR_INVALID
+#define CLR_INVALID CLR_NONE
+#endif
+
+/* MB_CUR_MAX is missing */
+#ifndef MB_CUR_MAX
+extern int *__imp___mb_cur_max;
+#define MB_CUR_MAX (*__imp___mb_cur_max)
+#endif
+
 #include <time.h>
 #include <gdk/gdktypes.h>
 
diff --git a/gdk/win32/makefile.cygwin b/gdk/win32/makefile.cygwin
new file mode 100644 (file)
index 0000000..86fbeb1
--- /dev/null
@@ -0,0 +1,89 @@
+## Makefile for building the GDK DLL with egcs on cygwin
+## Use: make -f makefile.cygwin install
+
+# Change this to wherever you want to install the DLL. This directory
+# should be in your PATH.
+BIN = bin
+
+# Location of the Wintab toolkit. Downloadable from http://www.pointing.com.
+# We use the wntab32x.lib archive library directly (copy it as libwntab32x.a).
+WTKIT = ../../../wtkit126
+
+OPTIMIZE = -g -O
+
+################################################################
+
+# Nothing much configurable below
+
+CC = gcc -mno-cygwin -mpentium
+
+CP = cp
+LD = ld
+INSTALL = install
+
+GLIB_VER=1.3
+GTK_VER=1.3
+
+GLIB = ../../../glib
+CFLAGS = -g -I. -I../.. -I$(WTKIT)/include -I$(GLIB) -DG_ENABLE_DEBUG -DHAVE_CONFIG_H -DGDK_VERSION=\"$(GTK_VER)\" -DNEAR= -DFAR=
+
+all: \
+       ../../config.h  \
+       gdk-$(GTK_VER).dll
+
+install : all
+       $(INSTALL) gdk-$(GTK_VER).dll $(BIN)
+
+gdk_OBJECTS = \
+       gdk.o           \
+       gdkcc.o         \
+       gdkcolor.o      \
+       gdkcursor.o     \
+       gdkdnd.o        \
+       gdkdraw.o       \
+       gdkevents.o     \
+       gdkfont.o       \
+       gdkgc.o         \
+       gdkglobals.o    \
+       gdkim.o         \
+       gdkimage.o      \
+       gdkinput.o      \
+       gdkpixmap.o     \
+       gdkproperty.o   \
+       gdkrgb.o        \
+       gdkrectangle.o  \
+       gdkregion.o     \
+       gdkselection.o  \
+       gdkvisual.o     \
+       gdkwindow.o     \
+       gdkxid.o
+
+../../config.h : ../../config.h.win32
+       $(CP) ../../config.h.win32 ../../config.h
+
+gdkres.o : rc/gdk.rc
+       windres --include-dir rc rc/gdk.rc gdkres.o
+
+gdk-$(GTK_VER).dll : $(gdk_OBJECTS) gdk.def gdkres.o libwntab32x.a
+       $(GLIB)/build-dll gdk $(GTK_VER) gdk.def $(gdk_OBJECTS) -L $(GLIB) -lglib-$(GLIB_VER) -L . -lwntab32x -lgdi32 -luser32 -lshell32 -lole32 -luuid $(LDFLAGS) gdkres.o
+
+libwntab32x.a : $(WTKIT)/lib/i386/wntab32x.lib
+       cp $(WTKIT)/lib/i386/wntab32x.lib libwntab32x.a
+
+.c.o :
+       $(CC) $(CFLAGS) -c -DGDK_COMPILATION -DG_LOG_DOMAIN=\"Gdk\" $<
+
+gdkrgb.c : ../gdkrgb.c
+       $(CP) ../gdkrgb.c .
+
+gdkrectangle.c : ../gdkrectangle.c
+       $(CP) ../gdkrectangle.c .
+
+testgdk.exe : testgdk.o gdk-$(GTK_VER).dll
+       $(CC) $(CFLAGS) -o $@ testgdk.o -L . -lgdk-$(GTK_VER) -L $(GLIB) -lglib-$(GLIB_VER) $(LDFLAGS)
+
+testgdk.o : testgdk.c
+       $(CC) $(CFLAGS) -c -DG_LOG_DOMAIN=\"testgdk\" testgdk.c
+
+clean:
+       -rm *.exe *.o *.dll *.a *.exp *.base
index 0594778ec288bc622edabe6c34720dd3051f2eb5..08076715937df6326bda3c60e8640cc2921a4547 100644 (file)
@@ -6,7 +6,7 @@
 BIN = C:\bin
 
 # Location of the Wintab toolkit. Downloadable from http://www.pointing.com.
-WTKIT = ..\..\..\wtkit125
+WTKIT = ..\..\..\wtkit126
 
 # Full optimization:
 OPTIMIZE = -Ox
@@ -17,18 +17,18 @@ OPTIMIZE = -Ox
 
 # Nothing much configurable below
 
-# cl -? described the options
+# cl -? describes the options
 CC = cl -G5 -GF $(OPTIMIZE) -W3 -MD -nologo
 
 LDFLAGS = /link /machine:ix86 # /debug /debugtype:cv
 INSTALL = copy
 TOUCH = copy makefile.msc+nul
 
-GLIB_VER=1.2
+GLIB_VER=1.3
 GTK_VER=1.3
 
-GLIB = ..\..\..\glib-$(GLIB_VER)
-CFLAGS = -I. -I..\.. -I$(WTKIT)\include -I$(GLIB) -DG_ENABLE_DEBUG -DHAVE_CONFIG_H -DGDK_VERSION=\"$(GTK_VER)\" # -DMULTIPLE_WINDOW_CLASSES
+GLIB = ..\..\..\glib
+CFLAGS = -I. -I..\.. -I$(WTKIT)\include -I$(GLIB) -DG_ENABLE_DEBUG -DHAVE_CONFIG_H -DGDK_VERSION=\"$(GTK_VER)\"
 
 all: \
        ..\..\config.h  \
index b1dac5795965debfd8be5e0708a16ee6b1118d2d..5a654a072cb7557cc6e56a171508b4a098a5d610 100644 (file)
 
 #include "config.h"
 
+#include <glib.h>              /* To get stat->_stat redefinition
+                                *  for mingw32
+                                */
+
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #define STRICT
 #include <windows.h>
 
-#ifdef _MSC_VER
+#ifdef NATIVE_WIN32
 #include <direct.h>
+#include <io.h>
+#define mkdir(p,m) _mkdir(p)
 #ifndef S_ISDIR
 #define S_ISDIR(mode) ((mode)&_S_IFDIR)
 #endif
-#define mkdir(path,mode) mkdir(path)
-#endif
-#endif
+
+#endif /* NATIVE_WIN32 */
+
+#endif /* WIN32 */
 
 #define DIR_LIST_WIDTH   180
 #define DIR_LIST_HEIGHT  180
index 1fdf303a8a003ddde843fbe0640f8e81f2c3f4c2..39c049f04281aabb866cbdb3fe90d4759008137f 100644 (file)
 #include <ctype.h>
 
 #include "gdk/gdk.h"
+/* Protect against the CHARSET struct in Win32 */
+#if GDK_WINDOWING == GDK_WINDOWING_WIN32
+# define CHARSET CHARSETstruct
+#endif
 #include "gdkx.h"
+#if GDK_WINDOWING == GDK_WINDOWING_WIN32
+# undef CHARSET
+#endif
 #include "gdk/gdkkeysyms.h"
 
 #include "gtkbutton.h"
index b0f2306af0c809bbf63f2cf6d2ce6b994ae7e773..554a7cd64ce1cc1b85320f6df58d035c7017b14a 100644 (file)
@@ -48,7 +48,7 @@
 #endif
 #include       <stdio.h>
 
-#ifdef _MSC_VER
+#ifdef NATIVE_WIN32
 #include       <io.h>          /* For _open and _close */
 
 #ifndef S_ISREG
index 0ee8c346134c6658843b5aad447c5b4feb8b767e..fa558da93a7656d68e4c5ea5cf18209d86fcabad 100644 (file)
@@ -439,13 +439,16 @@ gtk_init_check (int        *argc,
     }
   g_slist_free (gtk_modules);
   
+#ifndef NATIVE_WIN32
+  /* No use warning on Win32, there aren't any non-devel versions anyhow... */
   g_warning (""              "YOU ARE USING THE DEVEL BRANCH 1.3.x OF GTK+ WHICH IS CURRENTLY\n"
             "                UNDER HEAVY DEVELOPMENT AND FREQUENTLY INTRODUCES INSTABILITIES.\n"
             "                if you don't know why you are getting this, you probably want to\n"
             "                use the stable branch which can be retrived from\n"
             "                ftp://ftp.gtk.org/pub/gtk/v1.2/ or via CVS with\n"
             "                cvs checkout -r glib-1-2 glib; cvs checkout -r gtk-1-2 gtk+");
-  
+#endif
+
   return TRUE;
 }
 void
index 93c39e4dd18a3daaf2fa941347c0f8e3c7f63424..09d22a49b8a2f316e5f7d26bc0f74daf3b1d6e46 100644 (file)
@@ -50,7 +50,7 @@
 #define lstat stat
 #endif
 
-#ifdef _MSC_VER
+#ifdef NATIVE_WIN32
 #include <io.h>
 #endif
 
diff --git a/gtk/makefile.cygwin b/gtk/makefile.cygwin
new file mode 100644 (file)
index 0000000..af42316
--- /dev/null
@@ -0,0 +1,376 @@
+## Makefile for building the GTK DLL with egcs on cygwin
+## Use: make -f makefile.cygwin install
+
+# Change this to wherever you want to install the DLL. This directory
+# should be in your PATH.
+BIN = /bin
+
+# This is the location of pthreads for Win32, 
+# see http://sourceware.cygnus.com/pthreads-win32/
+PTHREADS = ../../pthreads-snap-1999-04-07
+PTHREAD_LIB = -L $(PTHREADS) -lpthread
+PTHREAD_INC = -I $(PTHREADS)
+
+OPTIMIZE = -g -O
+
+################################################################
+
+# Nothing much configurable below
+
+CC = gcc -mno-cygwin -mpentium
+
+# Perl and awk are needed to generate some source files.
+# These generated source files are distribuyted with the Win32 GTk+ source
+# distributions, so don't worry if you don't have perl and awk.
+PERL = perl
+AWK = awk
+
+INSTALL = install
+
+GLIB_VER=1.3
+GTK_VER=1.3
+
+GDKSYSDEP = ../gdk/win32
+GLIB = ../../glib
+
+CFLAGS = $(OPTIMIZE) -I. -I.. -I$(GDKSYSDEP) -I$(GLIB) -I$(GLIB)/gmodule -DGTK_DISABLE_COMPAT_H
+
+all : \
+       ../config.h     \
+       gtkcompat.h     \
+       generated       \
+       gtk-$(GTK_VER).dll\
+       testdnd.exe     \
+       testgtk.exe     \
+       testinput.exe   \
+       testrgb.exe     \
+       testselection.exe \
+       simple.exe
+
+install : all
+       $(INSTALL) gtk-$(GTK_VER).dll $(BIN)
+
+gtk_OBJECTS = \
+       fnmatch.o       \
+       gtkaccelgroup.o \
+       gtkaccellabel.o \
+       gtkadjustment.o \
+       gtkalignment.o  \
+       gtkarg.o        \
+       gtkarrow.o      \
+       gtkaspectframe.o\
+       gtkbbox.o       \
+       gtkbin.o        \
+       gtkbindings.o   \
+       gtkbox.o        \
+       gtkbutton.o     \
+       gtkcalendar.o   \
+       gtkcheckbutton.o\
+       gtkcheckmenuitem.o\
+       gtkclist.o      \
+       gtkcolorsel.o   \
+       gtkcombo.o      \
+       gtkcontainer.o  \
+       gtkctree.o      \
+       gtkcurve.o      \
+       gtkdata.o       \
+       gtkdialog.o     \
+       gtkdnd.o        \
+       gtkdrawingarea.o\
+       gtkeditable.o   \
+       gtkentry.o      \
+       gtkeventbox.o   \
+       gtkfilesel.o    \
+       gtkfixed.o      \
+       gtkfontsel.o    \
+       gtkframe.o      \
+       gtkgamma.o      \
+       gtkgc.o         \
+       gtkhandlebox.o  \
+       gtkhbbox.o      \
+       gtkhbox.o       \
+       gtkhpaned.o     \
+       gtkhruler.o     \
+       gtkhscale.o     \
+       gtkhscrollbar.o \
+       gtkhseparator.o \
+       gtkimage.o      \
+       gtkinputdialog.o\
+       gtkinvisible.o  \
+       gtkitem.o       \
+       gtkitemfactory.o\
+       gtklabel.o      \
+       gtklayout.o     \
+       gtklist.o       \
+       gtklistitem.o   \
+       gtkmain.o       \
+       gtkmarshal.o    \
+       gtkmenu.o       \
+       gtkmenubar.o    \
+       gtkmenufactory.o\
+       gtkmenuitem.o   \
+       gtkmenushell.o  \
+       gtkmisc.o       \
+       gtknotebook.o   \
+       gtkobject.o     \
+       gtkoptionmenu.o \
+       gtkpacker.o     \
+       gtkpaned.o      \
+       gtkpixmap.o     \
+       gtkplug.o       \
+       gtkpreview.o    \
+       gtkprogress.o   \
+       gtkprogressbar.o\
+       gtkradiobutton.o\
+       gtkradiomenuitem.o\
+       gtkrange.o      \
+       gtkrc.o         \
+       gtkruler.o      \
+       gtkscale.o      \
+       gtkscrollbar.o  \
+       gtkscrolledwindow.o\
+       gtkselection.o  \
+       gtkseparator.o  \
+       gtksignal.o     \
+       gtksocket.o     \
+       gtkspinbutton.o \
+       gtkstatusbar.o  \
+       gtkstyle.o      \
+       gtktable.o      \
+       gtktearoffmenuitem.o\
+       gtktext.o       \
+       gtkthemes.o     \
+       gtktipsquery.o  \
+       gtktogglebutton.o\
+       gtktoolbar.o    \
+       gtktooltips.o   \
+       gtktree.o       \
+       gtktreeitem.o   \
+       gtktypeutils.o  \
+       gtkvbbox.o      \
+       gtkvbox.o       \
+       gtkviewport.o   \
+       gtkvpaned.o     \
+       gtkvruler.o     \
+       gtkvscale.o     \
+       gtkvscrollbar.o \
+       gtkvseparator.o \
+       gtkwidget.o     \
+       gtkwindow.o
+
+# Source headers which are non-autogenerated headers
+source_headers = \
+       gtk.h                   \
+       gtkaccelgroup.h         \
+       gtkaccellabel.h         \
+       gtkadjustment.h         \
+       gtkalignment.h          \
+       gtkarg.h                \
+       gtkarrow.h              \
+       gtkaspectframe.h        \
+       gtkbin.h                \
+       gtkbindings.h           \
+       gtkbbox.h               \
+       gtkbox.h                \
+       gtkbutton.h             \
+       gtkcalendar.h           \
+       gtkcheckbutton.h        \
+       gtkcheckmenuitem.h      \
+       gtkclist.h              \
+       gtkcolorsel.h           \
+       gtkcombo.h              \
+       gtkcompat.h             \
+       gtkcontainer.h          \
+       gtkctree.h              \
+       gtkcurve.h              \
+       gtkdata.h               \
+       gtkdebug.h              \
+       gtkdialog.h             \
+       gtkdnd.h                \
+       gtkdrawingarea.h        \
+       gtkeditable.h           \
+       gtkentry.h              \
+       gtkenums.h              \
+       gtkeventbox.h           \
+       gtkfilesel.h            \
+       gtkfixed.h              \
+       gtkfontsel.h            \
+       gtkframe.h              \
+       gtkgamma.h              \
+       gtkgc.h                 \
+       gtkhandlebox.h          \
+       gtkhbbox.h              \
+       gtkhbox.h               \
+       gtkhpaned.h             \
+       gtkhruler.h             \
+       gtkhscale.h             \
+       gtkhscrollbar.h         \
+       gtkhseparator.h         \
+       gtkimage.h              \
+       gtkinputdialog.h        \
+       gtkintl.h               \
+       gtkinvisible.h          \
+       gtkitem.h               \
+       gtkitemfactory.h        \
+       gtklabel.h              \
+       gtklayout.h             \
+       gtklist.h               \
+       gtklistitem.h           \
+       gtkmain.h               \
+       gtkmenu.h               \
+       gtkmenubar.h            \
+       gtkmenufactory.h        \
+       gtkmenuitem.h           \
+       gtkmenushell.h          \
+       gtkmisc.h               \
+       gtknotebook.h           \
+       gtkobject.h             \
+       gtkoptionmenu.h         \
+       gtkpacker.h             \
+       gtkpaned.h              \
+       gtkpixmap.h             \
+       gtkplug.h               \
+       gtkpreview.h            \
+       gtkprivate.h            \
+       gtkprogress.h           \
+       gtkprogressbar.h        \
+       gtkradiobutton.h        \
+       gtkradiomenuitem.h      \
+       gtkrange.h              \
+       gtkrc.h                 \
+       gtkruler.h              \
+       gtkscale.h              \
+       gtkscrollbar.h          \
+       gtkscrolledwindow.h     \
+       gtkselection.h          \
+       gtkseparator.h          \
+       gtksignal.h             \
+       gtksocket.h             \
+       gtkspinbutton.h         \
+       gtkstyle.h              \
+       gtkstatusbar.h          \
+       gtktable.h              \
+       gtktearoffmenuitem.h    \
+       gtktext.h               \
+       gtkthemes.h             \
+       gtktipsquery.h          \
+       gtktogglebutton.h       \
+       gtktoolbar.h            \
+       gtktooltips.h           \
+       gtktree.h               \
+       gtktreeitem.h           \
+       gtktypeutils.h          \
+       gtkvbbox.h              \
+       gtkvbox.h               \
+       gtkviewport.h           \
+       gtkvpaned.h             \
+       gtkvruler.h             \
+       gtkvscale.h             \
+       gtkvscrollbar.h         \
+       gtkvseparator.h         \
+       gtkwidget.h             \
+       gtkwindow.h
+
+# More headers to use when autogenerating.
+gdk_headers = \
+       ../gdk/gdktypes.h \
+       ../gdk/gdkrgb.h
+
+../config.h : ../config.h.win32
+       cp ../config.h.win32 ../config.h
+
+gtkcompat.h : gtkcompat.h.win32
+       cp gtkcompat.h.win32 gtkcompat.h
+
+#
+# Generated source files:
+#
+generated : gtk.defs gtktypebuiltins.h gtktypebuiltins_vars.c gtktypebuiltins_ids.c gtktypebuiltins_evals.c gtkmarshal.h gtkmarshal.c
+
+gtk.defs : makeenums.pl gtk-boxed.defs $(source_headers) $(gdk_headers)
+       $(PERL) makeenums.pl defs $(source_headers) $(gdk_headers) >gd.tmp
+       cat gd.tmp gtk-boxed.defs >gtk.defs
+       rm gd.tmp
+
+# generate type identifier header (GTK_TYPE_WIDGET_FLAGS)
+gtktypebuiltins.h: gtk.defs maketypes.awk
+       $(AWK) -f maketypes.awk gtk.defs macros >gtktypebuiltins.h
+
+# generate type identifier variables (GTK_TYPE_WIDGET_FLAGS)
+gtktypebuiltins_vars.c: gtk.defs maketypes.awk
+       $(AWK) -f maketypes.awk gtk.defs variables >gtktypebuiltins_vars.c
+
+# generate type entries for type-id registration
+gtktypebuiltins_ids.c: gtk.defs maketypes.awk
+       $(AWK) -f maketypes.awk gtk.defs entries >gtktypebuiltins_ids.c
+
+# generate enum value arrays
+gtktypebuiltins_evals.c: makeenums.pl gtk.defs
+       $(PERL) makeenums.pl arrays $(source_headers) $(gdk_headers) >gtktypebuiltins_evals.c
+
+gtkmarshal.h gtkmarshal.c : gtkmarshal.list genmarshal.pl
+       $(PERL) genmarshal.pl
+       -rm gtkmarshal.c
+       mv s-gmc gtkmarshal.c
+       -rm gtkmarshal.h
+       mv s-gmh gtkmarshal.h
+
+#
+# Linking:
+#
+gtk-$(GTK_VER).dll : generated $(gtk_OBJECTS) gtk.def
+       $(GLIB)/build-dll gtk $(GTK_VER) gtk.def $(gtk_OBJECTS) -L $(GDKSYSDEP) -lgdk-$(GTK_VER) -L $(GLIB) -lglib-$(GLIB_VER) -lgmodule-$(GLIB_VER) -lgdi32 -luser32
+
+# General rule for compiling the objects into the DLL
+.c.o :
+       $(CC) $(CFLAGS) -c -DGTK_COMPILATION -DG_LOG_DOMAIN=\"Gtk\" $<
+
+#
+# Test programs:
+#
+testdnd.exe : testdnd.o
+       $(CC) $(CFLAGS) -o $@ testdnd.o -L . -lgtk-$(GTK_VER) -L $(GDKSYSDEP) -lgdk-$(GTK_VER) -L $(GLIB) -lglib-$(GLIB_VER) $(LDFLAGS)
+
+# Must have separate rules for these objects that don't go in the DLL
+testdnd.o : testdnd.c
+       $(CC) $(CFLAGS) -c -DG_LOG_DOMAIN=\"testdnd\" testdnd.c
+
+testgtk.exe : testgtk.o
+       $(CC) $(CFLAGS) -o $@  testgtk.o -L . -lgtk-$(GTK_VER) -L $(GDKSYSDEP) -lgdk-$(GTK_VER) -L $(GLIB) -lglib-$(GLIB_VER) $(LDFLAGS)
+
+testgtk.o : testgtk.c
+       $(CC) $(CFLAGS) -c -DG_LOG_DOMAIN=\"testgtk\" testgtk.c
+
+testinput.exe : testinput.o
+       $(CC) $(CFLAGS) -o $@  testinput.o -L . -lgtk-$(GTK_VER) -L $(GDKSYSDEP) -lgdk-$(GTK_VER) -L $(GLIB) -lglib-$(GLIB_VER) $(LDFLAGS)
+
+testinput.o : testinput.c
+       $(CC) $(CFLAGS) -c -DG_LOG_DOMAIN=\"testinput\" testinput.c
+
+testrgb.exe : testrgb.o
+       $(CC) $(CFLAGS) -o $@  testrgb.o -L . -lgtk-$(GTK_VER) -L $(GDKSYSDEP) -lgdk-$(GTK_VER) -L $(GLIB) -lglib-$(GLIB_VER) $(LDFLAGS)
+
+testrgb.o : testrgb.c
+       $(CC) $(CFLAGS) -c -DG_LOG_DOMAIN=\"testrgb\" testrgb.c
+
+testselection.exe : testselection.o
+       $(CC) $(CFLAGS) -o $@  testselection.o -L . -lgtk-$(GTK_VER) -L $(GDKSYSDEP) -lgdk-$(GTK_VER) -L $(GLIB) -lglib-$(GLIB_VER) $(LDFLAGS)
+
+testselection.o : testselection.c
+       $(CC) $(CFLAGS) -c -DG_LOG_DOMAIN=\"testselection\" testselection.c
+
+testthreads.exe : testthreads.o
+       $(CC) $(CFLAGS) -o $@  testthreads.o -L . -lgtk-$(GTK_VER) -L $(GDKSYSDEP) -lgdk-$(GTK_VER) -L $(GLIB) -lglib-$(GLIB_VER) -lgthread-$(GLIB_VER) $(PTHREAD_LIB) $(LDFLAGS)
+
+testthreads.o : testthreads.c
+       $(CC) $(CFLAGS) -I$(PTHREAD_INC) -c -DG_LOG_DOMAIN=\"testthreads\" -DUSE_PTHREADS=1 testthreads.c
+
+simple.exe : simple.o
+       $(CC) $(CFLAGS) -o $@  simple.o -L . -lgtk-$(GTK_VER) -L $(GDKSYSDEP) -lgdk-$(GTK_VER) -L $(GLIB) -lglib-$(GLIB_VER) $(LDFLAGS)
+
+simple.o : simple.c
+       $(CC) $(CFLAGS) -c -DG_LOG_DOMAIN=\"simple\" simple.c
+
+# The clean target doesn't remove the generated sources
+clean:
+       -rm *.exe *.o *.dll *.a *.exp *.base
index 7eb412e894686ffe230bdf377c27e08a9021a88f..d1066dd280472c4530c6d9bb5a465e7dc9943eef 100755 (executable)
@@ -7,8 +7,9 @@ BIN = C:\bin
 
 # This is the location of pthreads for Win32, 
 # see http://sourceware.cygnus.com/pthreads-win32/
-PTHREAD_LIB = ..\..\lib\pthread.lib
-PTHREAD_INC = ..\..\include
+PTHREADS = ..\..\pthreads-snap-1999-04-07
+PTHREAD_LIB = $(PTHREADS)\pthread.lib
+PTHREAD_INC = -I $(PTHREADS)
 
 # Full optimization:
 OPTIMIZE = -Ox
@@ -19,7 +20,7 @@ OPTIMIZE = -Ox
 
 # Nothing much configurable below
 
-# cl -? described the options
+# cl -? describes the options
 # Some files use near as an identifier
 CC = cl -G5 -GF $(OPTIMIZE) -W3 -MD -DHAVE_CONFIG_H -nologo -Dnear=xxnear
 
@@ -29,17 +30,15 @@ CC = cl -G5 -GF $(OPTIMIZE) -W3 -MD -DHAVE_CONFIG_H -nologo -Dnear=xxnear
 PERL = perl
 AWK = awk
 
-# MEMCHECKLIB = mcw50.lib
-
-LDFLAGS = /link /machine:ix86 # /debug /debugtype:cv
+LDFLAGS = /link /machine:ix86 # /debug
 INSTALL = copy
 TOUCH = copy makefile.msc+nul
 
-GLIB_VER=1.2
+GLIB_VER=1.3
 GTK_VER=1.3
 
 GDKSYSDEP = ..\gdk\win32
-GLIB = ..\..\glib-$(GLIB_VER)
+GLIB = ..\..\glib
 
 CFLAGS = -I. -I.. -I$(GDKSYSDEP) -I$(GLIB) -I$(GLIB)\gmodule -DGTK_DISABLE_COMPAT_H
 
@@ -329,7 +328,7 @@ gtkmarshal.h gtkmarshal.c : gtkmarshal.list genmarshal.pl
 # Linking:
 #
 gtk-$(GTK_VER).dll : $(gtk_OBJECTS) gtk.def
-       $(CC) $(CFLAGS) -LD -Fegtk-$(GTK_VER).dll $(gtk_OBJECTS) $(MEMCHECKLIB) $(GDKSYSDEP)\gdk-$(GTK_VER).lib $(GLIB)\glib-$(GLIB_VER).lib $(GLIB)\gmodule-$(GLIB_VER).lib gdi32.lib user32.lib $(LDFLAGS) /def:gtk.def
+       $(CC) $(CFLAGS) -LD -Fegtk-$(GTK_VER).dll $(gtk_OBJECTS) $(GDKSYSDEP)\gdk-$(GTK_VER).lib $(GLIB)\glib-$(GLIB_VER).lib $(GLIB)\gmodule-$(GLIB_VER).lib gdi32.lib user32.lib $(LDFLAGS) /def:gtk.def
 
 # General rule for compiling the objects into the DLL
 .c.obj :
@@ -338,44 +337,44 @@ gtk-$(GTK_VER).dll : $(gtk_OBJECTS) gtk.def
 #
 # Test programs:
 #
-testdnd.exe : testdnd.obj
+testdnd.exe : gtk-$(GTK_VER).dll testdnd.obj
        $(CC) $(CFLAGS) testdnd.obj gtk-$(GTK_VER).lib $(GDKSYSDEP)\gdk-$(GTK_VER).lib $(GLIB)\glib-$(GLIB_VER).lib $(LDFLAGS)
 
 # Must have separate rules for these objects that don't go in the DLL
 testdnd.obj : testdnd.c
        $(CC) $(CFLAGS) -c -DG_LOG_DOMAIN=\"testdnd\" testdnd.c
 
-testgtk.exe : testgtk.obj
-       $(CC) $(CFLAGS) testgtk.obj $(MEMCHECKLIB) gtk-$(GTK_VER).lib $(GDKSYSDEP)\gdk-$(GTK_VER).lib $(GLIB)\glib-$(GLIB_VER).lib $(LDFLAGS)
+testgtk.exe : gtk-$(GTK_VER).dll testgtk.obj
+       $(CC) $(CFLAGS) testgtk.obj gtk-$(GTK_VER).lib $(GDKSYSDEP)\gdk-$(GTK_VER).lib $(GLIB)\glib-$(GLIB_VER).lib $(LDFLAGS)
 
 testgtk.obj : testgtk.c
        $(CC) $(CFLAGS) -c -DG_LOG_DOMAIN=\"testgtk\" testgtk.c
 
-testinput.exe : testinput.obj
+testinput.exe : gtk-$(GTK_VER).dll testinput.obj
        $(CC) $(CFLAGS) testinput.obj gtk-$(GTK_VER).lib $(GDKSYSDEP)\gdk-$(GTK_VER).lib $(GLIB)\glib-$(GLIB_VER).lib $(LDFLAGS)
 
 testinput.obj : testinput.c
        $(CC) $(CFLAGS) -c -DG_LOG_DOMAIN=\"testinput\" testinput.c
 
-testrgb.exe : testrgb.obj
+testrgb.exe : gtk-$(GTK_VER).dll testrgb.obj
        $(CC) $(CFLAGS) testrgb.obj gtk-$(GTK_VER).lib $(GDKSYSDEP)\gdk-$(GTK_VER).lib $(GLIB)\glib-$(GLIB_VER).lib $(LDFLAGS)
 
 testrgb.obj : testrgb.c
        $(CC) $(CFLAGS) -c -DG_LOG_DOMAIN=\"testrgb\" testrgb.c
 
-testselection.exe : testselection.obj
+testselection.exe : gtk-$(GTK_VER).dll testselection.obj
        $(CC) $(CFLAGS) testselection.obj gtk-$(GTK_VER).lib $(GDKSYSDEP)\gdk-$(GTK_VER).lib $(GLIB)\glib-$(GLIB_VER).lib $(LDFLAGS)
 
 testselection.obj : testselection.c
        $(CC) $(CFLAGS) -c -DG_LOG_DOMAIN=\"testselection\" testselection.c
 
-testthreads.exe : testthreads.obj
+testthreads.exe : gtk-$(GTK_VER).dll testthreads.obj
        $(CC) $(CFLAGS) testthreads.obj gtk-$(GTK_VER).lib $(GDKSYSDEP)\gdk-$(GTK_VER).lib $(GLIB)\glib-$(GLIB_VER).lib $(GLIB)\gthread-$(GLIB_VER).lib $(PTHREAD_LIB) $(LDFLAGS)
 
 testthreads.obj : testthreads.c
-       $(CC) $(CFLAGS) -I$(PTHREAD_INC) -c -DG_LOG_DOMAIN=\"testthreads\" -DUSE_PTHREADS=1 testthreads.c
+       $(CC) $(CFLAGS) $(PTHREAD_INC) -c -DG_LOG_DOMAIN=\"testthreads\" -DUSE_PTHREADS=1 testthreads.c
 
-simple.exe : simple.obj
+simple.exe : gtk-$(GTK_VER).dll simple.obj
        $(CC) $(CFLAGS) simple.obj gtk-$(GTK_VER).lib $(GDKSYSDEP)\gdk-$(GTK_VER).lib $(GLIB)\glib-$(GLIB_VER).lib $(LDFLAGS)
 
 simple.obj : simple.c