summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-04-06 22:04:03 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-04-06 22:04:03 (GMT)
commitedf582e29363915f6b8ea7954176768d8545934f (patch)
tree845dc4e8e220a3589692bbc862c9d74649410158 /win
parentca830add40b2f1d21998d01aa0a67b9d0d4dd275 (diff)
downloadtk-edf582e29363915f6b8ea7954176768d8545934f.zip
tk-edf582e29363915f6b8ea7954176768d8545934f.tar.gz
tk-edf582e29363915f6b8ea7954176768d8545934f.tar.bz2
some more cygwin compatibility improvements
Diffstat (limited to 'win')
-rwxr-xr-x[-rw-r--r--]win/tcl.m420
-rwxr-xr-x[-rw-r--r--]win/tkWinDraw.c11
-rwxr-xr-x[-rw-r--r--]win/tkWinInt.h4
3 files changed, 20 insertions, 15 deletions
diff --git a/win/tcl.m4 b/win/tcl.m4
index 752f022..ab47afc 100644..100755
--- a/win/tcl.m4
+++ b/win/tcl.m4
@@ -34,7 +34,11 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [
AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR does not exist)
fi
if test ! -f $TCL_BIN_DIR/tclConfig.sh; then
- AC_MSG_ERROR(There is no tclConfig.sh in $TCL_BIN_DIR: perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?)
+ if test ! -f $TCL_BIN_DIR/../unix/tclConfig.sh; then
+ AC_MSG_ERROR(There is no tclConfig.sh in $TCL_BIN_DIR: perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?)
+ fi
+ TCL_BIN_DIR=`cd ${TCL_BIN_DIR}/../unix; pwd`
+ CFLAGS="$CFLAGS -mwin32"
fi
AC_MSG_RESULT($TCL_BIN_DIR/tclConfig.sh)
])
@@ -413,12 +417,12 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AC_CACHE_CHECK(for cross-compile version of gcc,
ac_cv_cross,
AC_TRY_COMPILE([
- #ifdef __WIN32__
+ #ifndef __WIN32__
#error cross-compiler
#endif
], [],
- ac_cv_cross=yes,
- ac_cv_cross=no)
+ ac_cv_cross=no,
+ ac_cv_cross=yes)
)
if test "$ac_cv_cross" = "yes"; then
@@ -589,12 +593,12 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
;;
*)
AC_TRY_COMPILE([
- #ifdef _WIN64
- #error 64-bit
+ #ifndef _WIN64
+ #error 32-bit
#endif
], [],
- tcl_win_64bit=no,
- tcl_win_64bit=yes
+ tcl_win_64bit=yes,
+ tcl_win_64bit=no
)
if test "$tcl_win_64bit" = "yes" ; then
do64bit=amd64
diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c
index d0a609f..805dde3 100644..100755
--- a/win/tkWinDraw.c
+++ b/win/tkWinDraw.c
@@ -24,7 +24,7 @@
* Translation table between X gc functions and Win32 raster op modes.
*/
-int tkpWinRopModes[] = {
+CONST int tkpWinRopModes[] = {
R2_BLACK, /* GXclear */
R2_MASKPEN, /* GXand */
R2_MASKPENNOT, /* GXandReverse */
@@ -55,7 +55,7 @@ int tkpWinRopModes[] = {
#define SRCORREVERSE (DWORD)0x00DD0228 /* dest = source OR (NOT dest) */
#define SRCNAND (DWORD)0x007700E6 /* dest = NOT (source AND dest) */
-int tkpWinBltModes[] = {
+CONST int tkpWinBltModes[] = {
BLACKNESS, /* GXclear */
SRCAND, /* GXand */
SRCERASE, /* GXandReverse */
@@ -93,9 +93,10 @@ int tkpWinBltModes[] = {
/*
* Macros used later in the file.
*/
-
-#define MIN(a,b) ((a>b) ? b : a)
-#define MAX(a,b) ((a<b) ? b : a)
+#ifndef MIN
+# define MIN(a,b) ((a>b) ? b : a)
+# define MAX(a,b) ((a<b) ? b : a)
+#endif
/*
* The followng typedef is used to pass Windows GDI drawing functions.
diff --git a/win/tkWinInt.h b/win/tkWinInt.h
index efff755..7ab4ff4 100644..100755
--- a/win/tkWinInt.h
+++ b/win/tkWinInt.h
@@ -128,8 +128,8 @@ typedef struct {
* Win32 raster and BitBlt op modes.
*/
-extern int tkpWinRopModes[];
-extern int tkpWinBltModes[];
+extern CONST int tkpWinRopModes[];
+extern CONST int tkpWinBltModes[];
/*
* The following defines are used with TkWinGetBorderPixels to get the