Tcl Source Code

Artifact [e62f69aa2c]
Login

Artifact e62f69aa2ca1a3231ff8c9c0a24df978a605676b:

Attachment "ie_default.patch" to ticket [525403ffff] added by mdejong 2002-03-06 15:20:51.
2002-03-03  Mo DeJong  <[email protected]>

	* win/configure: Regen.
	* win/configure.in: Check that _WIN32_IE is defined
	before including commctrl.h so we get access to
	the InitCommonControlsEx API. This should only
	be a problem when compiling with mingw 1.1.
	* win/tkWinX.c: Define _WIN32_IE before including
	commctrl.h when HAVE_NO_IE_DEFAULT is defined.

Index: win/configure.in
===================================================================
RCS file: /cvsroot/tktoolkit/tk/win/configure.in,v
retrieving revision 1.40
diff -u -r1.40 configure.in
--- win/configure.in	11 Jan 2002 20:56:38 -0000	1.40
+++ win/configure.in	6 Mar 2002 08:18:54 -0000
@@ -74,6 +74,42 @@
 AC_EXEEXT
 
 #--------------------------------------------------------------------
+# Check compiler specific defines that might be needed
+#--------------------------------------------------------------------
+
+AC_CACHE_CHECK(that _WIN32_IE is defined,
+    tk_cv_win32_ie,
+AC_TRY_COMPILE([
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#include <commctrl.h>],
+        [INITCOMMONCONTROLSEX comctl;
+        InitCommonControlsEx(&comctl);],
+        tk_cv_win32_ie=yes,
+        tk_cv_win32_ie=no)
+if test "$tk_cv_win32_ie" = "no" ; then
+    AC_TRY_COMPILE([
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#define _WIN32_IE 0x0300
+#include <commctrl.h>],
+        [INITCOMMONCONTROLSEX comctl;
+        InitCommonControlsEx(&comctl);],
+        tk_ok=yes,
+        AC_MSG_ERROR([_WIN32_IE define did not fix commctrl.h]))
+fi
+)
+if test "$tk_cv_win32_ie" = "no" ; then
+    if test "$tk_ok" = "yes" ; then
+        AC_DEFINE(HAVE_NO_IE_DEFAULT,,
+            [Defined when mingw does not set _WIN32_IE])
+    fi
+fi
+
+
+#--------------------------------------------------------------------
 # Check whether --enable-threads or --disable-threads was given.
 #--------------------------------------------------------------------
 
Index: win/tkWinX.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/win/tkWinX.c,v
retrieving revision 1.18
diff -u -r1.18 tkWinX.c
--- win/tkWinX.c	25 Jan 2002 21:09:37 -0000	1.18
+++ win/tkWinX.c	6 Mar 2002 08:18:55 -0000
@@ -14,6 +14,16 @@
  */
 
 #include "tkWinInt.h"
+
+/*
+ * Mingw 1.1 does not define _WIN32_IE by default so we need to set it
+ * to gain access to the InitCommonControlsEx API in commctrl.h.
+ */
+
+#ifdef HAVE_NO_IE_DEFAULT
+#define _WIN32_IE 0x0300
+#endif
+
 #include <commctrl.h>
 
 /*