diff options
author | nijtmans@users.sourceforge.net <jan.nijtmans> | 2012-04-12 21:04:47 (GMT) |
---|---|---|
committer | nijtmans@users.sourceforge.net <jan.nijtmans> | 2012-04-12 21:04:47 (GMT) |
commit | ff7105a5d8c980e3a3791370b90fc605577e19fc (patch) | |
tree | 063bedd2c23caf56c700b120451a3e5f80fe1def | |
parent | 76503d5238952ba851a6ae433b59fc8a8801e9ae (diff) | |
parent | a70bae29d767e9bb9fbc71844b6e2e0a209150c6 (diff) | |
download | tk-ff7105a5d8c980e3a3791370b90fc605577e19fc.zip tk-ff7105a5d8c980e3a3791370b90fc605577e19fc.tar.gz tk-ff7105a5d8c980e3a3791370b90fc605577e19fc.tar.bz2 |
merge trunk
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | generic/tk.decls | 8 | ||||
-rw-r--r-- | generic/tkBind.c | 2 | ||||
-rw-r--r-- | generic/tkColor.c | 2 | ||||
-rw-r--r-- | generic/tkInt.decls | 2 | ||||
-rw-r--r-- | generic/tkMain.c | 2 | ||||
-rwxr-xr-x | unix/configure | 143 | ||||
-rw-r--r-- | unix/tcl.m4 | 42 | ||||
-rwxr-xr-x | win/configure | 744 | ||||
-rw-r--r-- | win/configure.in | 29 | ||||
-rw-r--r-- | win/tcl.m4 | 244 | ||||
-rw-r--r-- | win/tkWinDraw.c | 11 | ||||
-rw-r--r-- | win/tkWinInt.h | 4 | ||||
-rw-r--r-- | win/tkWinMenu.c | 2 | ||||
-rw-r--r-- | xlib/xcolors.c | 13 |
15 files changed, 960 insertions, 301 deletions
@@ -1,3 +1,16 @@ +2012-04-07 Jan Nijtmans <nijtmans@users.sf.net> + + * generic/tkBind.c: [Bug 3176239] control-MouseWheel causes segv + +2012-03-30 Jan Nijtmans <nijtmans@users.sf.net> + + * unix/tcl.m4: [Bug 3511806] Compiler checks too early + * unix/configure.in: This change allows to build the cygwin + * unix/configure and mingw32 ports of Tcl/Tk to build + * win/tcl.m4: out-of-the-box using a native or cross- + * win/configure.in: compiler. + * win/configure + 2012-03-21 Jan Nijtmans <nijtmans@users.sf.net> * generic/tkColor.c: [Bug 2809525] Abort on overlong color name. diff --git a/generic/tk.decls b/generic/tk.decls index f37be47..2671421 100644 --- a/generic/tk.decls +++ b/generic/tk.decls @@ -746,7 +746,6 @@ declare 194 { declare 195 { void Tk_FreeConfigOptions(char *recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin) - } declare 196 { void Tk_FreeSavedOptions(Tk_SavedOptions *savePtr) @@ -828,15 +827,12 @@ declare 216 { declare 217 { void Tk_CreateSmoothMethod(Tcl_Interp *interp, const Tk_SmoothMethod *method) } - #declare 218 { # void Tk_CreateCanvasVisitor(Tcl_Interp *interp, void *typePtr) #} - #declare 219 { # void *Tk_GetCanvasVisitor(Tcl_Interp *interp, const char *name) #} - declare 220 { int Tk_GetDash(Tcl_Interp *interp, const char *value, Tk_Dash *dash) } @@ -1167,3 +1163,7 @@ export { const char *Tk_PkgInitStubsCheck(Tcl_Interp *interp, const char *version, int exact) } + +# Local Variables: +# mode: tcl +# End: diff --git a/generic/tkBind.c b/generic/tkBind.c index 53a2046..6841f1e 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -2147,7 +2147,7 @@ ExpandPercents( } goto doNumber; case 'A': - if (flags & KEY) { + if ((flags & KEY) && (eventPtr->type != MouseWheelEvent)) { Tcl_DStringFree(&buf); string = TkpGetString(winPtr, eventPtr, &buf); } diff --git a/generic/tkColor.c b/generic/tkColor.c index c538365..f1258f5 100644 --- a/generic/tkColor.c +++ b/generic/tkColor.c @@ -868,8 +868,8 @@ TkParseColor( const char *name, /* String to be parsed */ XColor *color) { + char buf[14]; if (*name == '#') { - char buf[14]; buf[0] = '#'; buf[13] = '\0'; if (!*(++name) || !*(++name) || !*(++name)) { /* Not at least 3 hex digits, so invalid */ diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 113d5d6..2f58dde 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -305,7 +305,6 @@ declare 83 { # void TkSetClassProcs(Tk_Window tkwin, # TkClassProcs *procs, ClientData instanceData) #} - declare 85 { void TkSetWindowMenuBar(Tcl_Interp *interp, Tk_Window tkwin, const char *oldMenuName, const char *menuName) @@ -1037,7 +1036,6 @@ declare 9 win { declare 10 win { XHostAddress *XListHosts(Display *d, int *i, Bool *b) } - # second parameter was of type KeyCode declare 11 win { KeySym XKeycodeToKeysym(Display *d, unsigned int k, int i) diff --git a/generic/tkMain.c b/generic/tkMain.c index fee669e..a48ddd4 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -187,7 +187,7 @@ Tk_MainEx( is.gotPartial = 0; Tcl_Preserve(interp); -#if defined(__WIN32__) +#if defined(__WIN32__) && !defined(__CYGWIN__) Tk_InitConsoleChannels(interp); #endif diff --git a/unix/configure b/unix/configure index 5b28fa9..7c8b7cf 100755 --- a/unix/configure +++ b/unix/configure @@ -4890,17 +4890,80 @@ fi CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; - CYGWIN_*) + CYGWIN_*|MINGW32*) SHLIB_CFLAGS="" SHLIB_LD='${CC} -shared' SHLIB_SUFFIX=".dll" - DL_OBJS="tclLoadDl.o" + DL_OBJS="tclLoadDl.o tclWinError.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" TCL_NEEDS_EXP_FILE=1 TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.dll.a' TCL_SHLIB_LD_EXTRAS='-Wl,--out-implib,$@.a' + echo "$as_me:$LINENO: checking for Cygwin version of gcc" >&5 +echo $ECHO_N "checking for Cygwin version of gcc... $ECHO_C" >&6 +if test "${ac_cv_cygwin+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + #ifdef __CYGWIN__ + #error cygwin + #endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_cygwin=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_cygwin=yes +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $ac_cv_cygwin" >&5 +echo "${ECHO_T}$ac_cv_cygwin" >&6 + if test "$ac_cv_cygwin" = "no"; then + { { echo "$as_me:$LINENO: error: ${CC} is not a cygwin compiler." >&5 +echo "$as_me: error: ${CC} is not a cygwin compiler." >&2;} + { (exit 1); exit 1; }; } + fi ;; dgux*) SHLIB_CFLAGS="-K PIC" @@ -6870,7 +6933,7 @@ fi case $system in AIX-*) ;; BSD/OS*) ;; - CYGWIN_*) ;; + CYGWIN_*|MINGW32_*) ;; IRIX*) ;; NetBSD-*|FreeBSD-*|OpenBSD-*) ;; Darwin-*) ;; @@ -6968,6 +7031,75 @@ fi + # See if the compiler supports casting to a union type. + # This is used to stop gcc from printing a compiler + # warning when initializing a union member. + + echo "$as_me:$LINENO: checking for cast to union support" >&5 +echo $ECHO_N "checking for cast to union support... $ECHO_C" >&6 +if test "${tcl_cv_cast_to_union+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + union foo { int i; double d; }; + union foo f = (union foo) (int) 0; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_cast_to_union=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cast_to_union=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $tcl_cv_cast_to_union" >&5 +echo "${ECHO_T}$tcl_cv_cast_to_union" >&6 + if test "$tcl_cv_cast_to_union" = "yes"; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_CAST_TO_UNION 1 +_ACEOF + + fi + # FIXME: This subst was left in only because the TCL_DL_LIBS # entry in tclConfig.sh uses it. It is not clear why someone # would use TCL_DL_LIBS instead of TCL_LIBS. @@ -7024,6 +7156,11 @@ fi; if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)' + +cat >>confdefs.h <<\_ACEOF +#define NDEBUG 1 +_ACEOF + echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 diff --git a/unix/tcl.m4 b/unix/tcl.m4 index cb6c842..28b323f 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -738,6 +738,7 @@ AC_DEFUN([SC_ENABLE_SYMBOLS], [ if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)' + AC_DEFINE(NDEBUG, 1, [Is no debugging enabled?]) AC_MSG_RESULT([no]) AC_DEFINE(TCL_CFG_OPTIMIZED, 1, [Is this an optimized build?]) else @@ -1220,17 +1221,30 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; - CYGWIN_*) + CYGWIN_*|MINGW32*) SHLIB_CFLAGS="" SHLIB_LD='${CC} -shared' SHLIB_SUFFIX=".dll" - DL_OBJS="tclLoadDl.o" + DL_OBJS="tclLoadDl.o tclWinError.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" TCL_NEEDS_EXP_FILE=1 TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.dll.a' TCL_SHLIB_LD_EXTRAS='-Wl,--out-implib,$[@].a' + AC_CACHE_CHECK(for Cygwin version of gcc, + ac_cv_cygwin, + AC_TRY_COMPILE([ + #ifdef __CYGWIN__ + #error cygwin + #endif + ], [], + ac_cv_cygwin=no, + ac_cv_cygwin=yes) + ) + if test "$ac_cv_cygwin" = "no"; then + AC_MSG_ERROR([${CC} is not a cygwin compiler.]) + fi ;; dgux*) SHLIB_CFLAGS="-K PIC" @@ -2058,7 +2072,7 @@ dnl # preprocessing tests use only CPPFLAGS. case $system in AIX-*) ;; BSD/OS*) ;; - CYGWIN_*) ;; + CYGWIN_*|MINGW32_*) ;; IRIX*) ;; NetBSD-*|FreeBSD-*|OpenBSD-*) ;; Darwin-*) ;; @@ -2115,6 +2129,25 @@ dnl # preprocessing tests use only CPPFLAGS. TCL_LIBS="${DL_LIBS} ${LIBS} ${MATH_LIBS}"]) AC_SUBST(TCL_LIBS) + # See if the compiler supports casting to a union type. + # This is used to stop gcc from printing a compiler + # warning when initializing a union member. + + AC_CACHE_CHECK(for cast to union support, + tcl_cv_cast_to_union, + AC_TRY_COMPILE([], + [ + union foo { int i; double d; }; + union foo f = (union foo) (int) 0; + ], + tcl_cv_cast_to_union=yes, + tcl_cv_cast_to_union=no) + ) + if test "$tcl_cv_cast_to_union" = "yes"; then + AC_DEFINE(HAVE_CAST_TO_UNION, 1, + [Defined when compiler supports casting to union type.]) + fi + # FIXME: This subst was left in only because the TCL_DL_LIBS # entry in tclConfig.sh uses it. It is not clear why someone # would use TCL_DL_LIBS instead of TCL_LIBS. @@ -3264,7 +3297,8 @@ AC_DEFUN([SC_TCL_IPV6],[ #include <netdb.h> ]]) if test "x$NEED_FAKE_RFC2553" = "x1"; then - AC_DEFINE(NEED_FAKE_RFC2553) + AC_DEFINE([NEED_FAKE_RFC2553], 1, + [Use compat implementation of getaddrinfo() and friends]) AC_LIBOBJ([fake-rfc2553]) AC_CHECK_FUNC(strlcpy) fi diff --git a/win/configure b/win/configure index 4f5501c..fc8f41c 100755 --- a/win/configure +++ b/win/configure @@ -309,7 +309,7 @@ ac_includes_default="\ # include <unistd.h> #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP AR ac_ct_AR RANLIB ac_ct_RANLIB RC ac_ct_RC SET_MAKE TCL_THREADS CYGPATH CELIB_DIR DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING MAN2TCLFLAGS CFLAGS_DEFAULT LDFLAGS_DEFAULT VC_MANIFEST_EMBED_DLL VC_MANIFEST_EMBED_EXE TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_DEFS BUILD_TCLSH TCLSH_PROG TK_WIN_VERSION MACHINE TK_VERSION TK_MAJOR_VERSION TK_MINOR_VERSION TK_PATCH_LEVEL TK_DBGX TK_LIB_FILE TK_DLL_FILE TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_BUILD_STUB_LIB_SPEC TK_SRC_DIR TK_BIN_DIR TCL_MAJOR_VERSION TCL_MINOR_VERSION TCL_PATCH_LEVEL TCL_DBGX CFG_TK_SHARED_LIB_SUFFIX CFG_TK_UNSHARED_LIB_SUFFIX CFG_TK_EXPORT_FILE_SUFFIX EXTRA_CFLAGS DEPARG CC_OBJNAME CC_EXENAME LDFLAGS_DEBUG LDFLAGS_OPTIMIZE LDFLAGS_CONSOLE LDFLAGS_WINDOW TK_RES STLIB_LD SHLIB_LD SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX TK_SHARED_BUILD LIBS_GUI DLLSUFFIX LIBPREFIX LIBSUFFIX EXESUFFIX LIBRARIES MAKE_LIB POST_MAKE_LIB MAKE_DLL MAKE_EXE TK_LIB_FLAG TK_LIB_SPEC TK_BUILD_LIB_SPEC TK_STUB_LIB_SPEC TK_STUB_LIB_PATH TK_BUILD_STUB_LIB_PATH TK_CC_SEARCH_FLAGS TK_LD_SEARCH_FLAGS RC_OUT RC_TYPE RC_INCLUDE RC_DEFINE RC_DEFINES RES LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP AR ac_ct_AR RANLIB ac_ct_RANLIB RC ac_ct_RC SET_MAKE TCL_THREADS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_DEFS CYGPATH CELIB_DIR DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING MAN2TCLFLAGS CFLAGS_DEFAULT LDFLAGS_DEFAULT VC_MANIFEST_EMBED_DLL VC_MANIFEST_EMBED_EXE BUILD_TCLSH TCLSH_PROG TK_WIN_VERSION MACHINE TK_VERSION TK_MAJOR_VERSION TK_MINOR_VERSION TK_PATCH_LEVEL TK_DBGX TK_LIB_FILE TK_DLL_FILE TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_BUILD_STUB_LIB_SPEC TK_SRC_DIR TK_BIN_DIR TCL_MAJOR_VERSION TCL_MINOR_VERSION TCL_PATCH_LEVEL TCL_DBGX CFG_TK_SHARED_LIB_SUFFIX CFG_TK_UNSHARED_LIB_SUFFIX CFG_TK_EXPORT_FILE_SUFFIX EXTRA_CFLAGS DEPARG CC_OBJNAME CC_EXENAME LDFLAGS_DEBUG LDFLAGS_OPTIMIZE LDFLAGS_CONSOLE LDFLAGS_WINDOW TK_RES STLIB_LD SHLIB_LD SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX TK_SHARED_BUILD LIBS_GUI DLLSUFFIX LIBPREFIX LIBSUFFIX EXESUFFIX LIBRARIES MAKE_LIB POST_MAKE_LIB MAKE_DLL MAKE_EXE TK_LIB_FLAG TK_LIB_SPEC TK_BUILD_LIB_SPEC TK_STUB_LIB_SPEC TK_STUB_LIB_PATH TK_BUILD_STUB_LIB_PATH TK_CC_SEARCH_FLAGS TK_LD_SEARCH_FLAGS RC_OUT RC_TYPE RC_INCLUDE RC_DEFINE RC_DEFINES RES LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -851,8 +851,8 @@ Optional Features: Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-celib=DIR use Windows/CE support library from DIR --with-tcl=DIR use Tcl 8.6 binaries from DIR + --with-celib=DIR use Windows/CE support library from DIR Some influential environment variables: CC C compiler command @@ -3029,11 +3029,6 @@ fi #-------------------------------------------------------------------- -# Perform additinal compiler tests. -#-------------------------------------------------------------------- - - -#-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- @@ -3116,6 +3111,101 @@ _ACEOF #-------------------------------------------------------------------- +# Locate and source the tclConfig.sh file. +#-------------------------------------------------------------------- + + + echo "$as_me:$LINENO: checking the location of tclConfig.sh" >&5 +echo $ECHO_N "checking the location of tclConfig.sh... $ECHO_C" >&6 + + if test -d ../../tcl8.6$TK_PATCH_LEVEL/win; then + TCL_BIN_DIR_DEFAULT=../../tcl8.6$TK_PATCH_LEVEL/win + elif test -d ../../tcl8.6/win; then + TCL_BIN_DIR_DEFAULT=../../tcl8.6/win + else + TCL_BIN_DIR_DEFAULT=../../tcl/win + fi + + +# Check whether --with-tcl or --without-tcl was given. +if test "${with_tcl+set}" = set; then + withval="$with_tcl" + TCL_BIN_DIR=$withval +else + TCL_BIN_DIR=`cd $TCL_BIN_DIR_DEFAULT; pwd` +fi; + if test ! -d $TCL_BIN_DIR; then + { { echo "$as_me:$LINENO: error: Tcl directory $TCL_BIN_DIR does not exist" >&5 +echo "$as_me: error: Tcl directory $TCL_BIN_DIR does not exist" >&2;} + { (exit 1); exit 1; }; } + fi + if test ! -f $TCL_BIN_DIR/tclConfig.sh; then + if test ! -f $TCL_BIN_DIR/../unix/tclConfig.sh; then + { { echo "$as_me:$LINENO: 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?" >&5 +echo "$as_me: 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?" >&2;} + { (exit 1); exit 1; }; } + fi + TCL_BIN_DIR=`cd ${TCL_BIN_DIR}/../unix; pwd` + fi + echo "$as_me:$LINENO: result: $TCL_BIN_DIR/tclConfig.sh" >&5 +echo "${ECHO_T}$TCL_BIN_DIR/tclConfig.sh" >&6 + + + echo "$as_me:$LINENO: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 +echo $ECHO_N "checking for existence of $TCL_BIN_DIR/tclConfig.sh... $ECHO_C" >&6 + + if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then + echo "$as_me:$LINENO: result: loading" >&5 +echo "${ECHO_T}loading" >&6 + . $TCL_BIN_DIR/tclConfig.sh + else + echo "$as_me:$LINENO: result: file not found" >&5 +echo "${ECHO_T}file not found" >&6 + fi + + # + # If the TCL_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable TCL_LIB_SPEC will be set to the value + # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC + # instead of TCL_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + # + + if test -f $TCL_BIN_DIR/Makefile ; then + TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} + TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} + TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} + fi + + # + # eval is required to do the TCL_DBGX substitution + # + + eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" + eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" + eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" + + eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" + eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" + eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" + + + + + + + + + + + + + + + + +#-------------------------------------------------------------------- # The statements below define a collection of compile flags. This # macro depends on the value of SHARED_BUILD, and should be called # after SC_ENABLE_SHARED checks the configure switches. @@ -3287,6 +3377,90 @@ fi # which requires x86|amd64|ia64. MACHINE="X86" + if test "$GCC" = "yes"; then + + if test "$TCL_CC" = "gcc"; then + CFLAGS="$CFLAGS -mwin32" + fi + echo "$as_me:$LINENO: checking for cross-compile version of gcc" >&5 +echo $ECHO_N "checking for cross-compile version of gcc... $ECHO_C" >&6 +if test "${ac_cv_cross+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + #ifndef __WIN32__ + #error cross-compiler + #endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_cross=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_cross=yes +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $ac_cv_cross" >&5 +echo "${ECHO_T}$ac_cv_cross" >&6 + + if test "$ac_cv_cross" = "yes"; then + case "$do64bit" in + amd64|x64|yes) + CC="x86_64-w64-mingw32-gcc" + LD="x86_64-w64-mingw32-ld" + AR="x86_64-w64-mingw32-ar" + RANLIB="x86_64-w64-mingw32-ranlib" + RC="x86_64-w64-mingw32-windres" + ;; + *) + CC="i686-w64-mingw32-gcc" + LD="i686-w64-mingw32-ld" + AR="i686-w64-mingw32-ar" + RANLIB="i686-w64-mingw32-ranlib" + RC="i686-w64-mingw32-windres" + ;; + esac + fi + fi + # Check for a bug in gcc's windres that causes the # compile to fail when a Windows native path is # passed into windres. The mingw toolchain requires @@ -3320,9 +3494,18 @@ echo "${ECHO_T}yes" >&6 cyg_conftest= fi - echo "$as_me:$LINENO: checking for Cygwin version of gcc" >&5 -echo $ECHO_N "checking for Cygwin version of gcc... $ECHO_C" >&6 -if test "${ac_cv_cygwin+set}" = set; then + if test "$CYGPATH" = "echo"; then + DEPARG='"$<"' + else + DEPARG='"$(shell $(CYGPATH) $<)"' + fi + + # set various compiler flags depending on whether we are using gcc or cl + + if test "${GCC}" = "yes" ; then + echo "$as_me:$LINENO: checking for mingw32 version of gcc" >&5 +echo $ECHO_N "checking for mingw32 version of gcc... $ECHO_C" >&6 +if test "${ac_cv_win32+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -3332,9 +3515,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - #ifdef __CYGWIN__ - #error cygwin - #endif + #ifdef __WIN32__ + #error win32 + #endif int main () @@ -3366,73 +3549,26 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_cygwin=no + ac_cv_win32=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_cygwin=yes +ac_cv_win32=yes fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_cygwin" >&5 -echo "${ECHO_T}$ac_cv_cygwin" >&6 - if test "$ac_cv_cygwin" = "yes" ; then - { echo "$as_me:$LINENO: WARNING: Compiling under Cygwin is not currently supported. -If you are not sure you want this, see the README -file for information about building with Mingw." >&5 -echo "$as_me: WARNING: Compiling under Cygwin is not currently supported. -If you are not sure you want this, see the README -file for information about building with Mingw." >&2;} - fi - if test "$CYGPATH" = "echo" || test "$ac_cv_cygwin" = "yes"; then - DEPARG='"$<"' - else - DEPARG='"$(shell $(CYGPATH) $<)"' - fi - - # set various compiler flags depending on whether we are using gcc or cl - - echo "$as_me:$LINENO: checking compiler flags" >&5 -echo $ECHO_N "checking compiler flags... $ECHO_C" >&6 - if test "${GCC}" = "yes" ; then - SHLIB_LD="" - SHLIB_LD_LIBS='${LIBS}' - LIBS="-lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32" - # mingw needs to link ole32 and oleaut32 for [send], but MSVC doesn't - LIBS_GUI="-lgdi32 -lcomdlg32 -limm32 -lcomctl32 -lshell32 -luuid -lole32 -loleaut32" - STLIB_LD='${AR} cr' - RC_OUT=-o - RC_TYPE= - RC_INCLUDE=--include - RC_DEFINE=--define - RES=res.o - MAKE_LIB="\${STLIB_LD} \$@" - POST_MAKE_LIB="\${RANLIB} \$@" - MAKE_EXE="\${CC} -o \$@" - LIBPREFIX="lib" - - extra_cflags="-pipe" - extra_ldflags="-pipe" - - if test "$ac_cv_cygwin" = "yes"; then - touch ac$$.c - if ${CC} -c -mwin32 ac$$.c >/dev/null 2>&1; then - case "$extra_cflags" in - *-mwin32*) ;; - *) extra_cflags="-mwin32 $extra_cflags" ;; - esac - case "$extra_ldflags" in - *-mwin32*) ;; - *) extra_ldflags="-mwin32 $extra_ldflags" ;; - esac - fi - rm -f ac$$.o ac$$.c +echo "$as_me:$LINENO: result: $ac_cv_win32" >&5 +echo "${ECHO_T}$ac_cv_win32" >&6 + if test "$ac_cv_win32" != "yes"; then + { { echo "$as_me:$LINENO: error: ${CC} cannot produce win32 executables." >&5 +echo "$as_me: error: ${CC} cannot produce win32 executables." >&2;} + { (exit 1); exit 1; }; } fi hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -mwindows -municode -Dmain=xxmain" - echo "$as_me:$LINENO: checking for working -municode linker flag" >&5 + echo "$as_me:$LINENO: checking for working -municode linker flag" >&5 echo $ECHO_N "checking for working -municode linker flag... $ECHO_C" >&6 if test "${ac_cv_municode+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3444,8 +3580,8 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - #include <windows.h> - int APIENTRY wWinMain(HINSTANCE a, HINSTANCE b, LPWSTR c, int d) {return 0;} + #include <windows.h> + int APIENTRY wWinMain(HINSTANCE a, HINSTANCE b, LPWSTR c, int d) {return 0;} int main () @@ -3490,13 +3626,36 @@ rm -f conftest.err conftest.$ac_objext \ fi echo "$as_me:$LINENO: result: $ac_cv_municode" >&5 echo "${ECHO_T}$ac_cv_municode" >&6 - CFLAGS=$hold_cflags - if test "$ac_cv_municode" = "yes" ; then - extra_ldflags="$extra_ldflags -municode" - else - extra_cflags="$extra_cflags -DTCL_BROKEN_MAINARGS" + CFLAGS=$hold_cflags + if test "$ac_cv_municode" = "yes" ; then + extra_ldflags="$extra_ldflags -municode" + else + extra_cflags="$extra_cflags -DTCL_BROKEN_MAINARGS" + fi fi + echo "$as_me:$LINENO: checking compiler flags" >&5 +echo $ECHO_N "checking compiler flags... $ECHO_C" >&6 + if test "${GCC}" = "yes" ; then + SHLIB_LD="" + SHLIB_LD_LIBS='${LIBS}' + LIBS="-lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32" + # mingw needs to link ole32 and oleaut32 for [send], but MSVC doesn't + LIBS_GUI="-lgdi32 -lcomdlg32 -limm32 -lcomctl32 -lshell32 -luuid -lole32 -loleaut32" + STLIB_LD='${AR} cr' + RC_OUT=-o + RC_TYPE= + RC_INCLUDE=--include + RC_DEFINE=--define + RES=res.o + MAKE_LIB="\${STLIB_LD} \$@" + POST_MAKE_LIB="\${RANLIB} \$@" + MAKE_EXE="\${CC} -o \$@" + LIBPREFIX="lib" + + extra_ldflags="$extra_ldflags -pipe" + extra_cflags="$extra_cflags -pipe" + if test "${SHARED_BUILD}" = "0" ; then # static echo "$as_me:$LINENO: result: using static flags" >&5 @@ -3586,9 +3745,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - #ifdef _WIN64 - #error 64-bit - #endif + #ifndef _WIN64 + #error 32-bit + #endif int main () @@ -3620,12 +3779,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - tcl_win_64bit=no + tcl_win_64bit=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -tcl_win_64bit=yes +tcl_win_64bit=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext @@ -3933,6 +4092,291 @@ _ACEOF fi + if test "${GCC}" = "yes" ; then + echo "$as_me:$LINENO: checking for SEH support in compiler" >&5 +echo $ECHO_N "checking for SEH support in compiler... $ECHO_C" >&6 +if test "${tcl_cv_seh+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + tcl_cv_seh=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + #define WIN32_LEAN_AND_MEAN + #include <windows.h> + #undef WIN32_LEAN_AND_MEAN + + int main(int argc, char** argv) { + int a, b = 0; + __try { + a = 666 / b; + } + __except (EXCEPTION_EXECUTE_HANDLER) { + return 0; + } + return 1; + } + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_seh=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +tcl_cv_seh=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + +fi +echo "$as_me:$LINENO: result: $tcl_cv_seh" >&5 +echo "${ECHO_T}$tcl_cv_seh" >&6 + if test "$tcl_cv_seh" = "no" ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_NO_SEH 1 +_ACEOF + + fi + + # + # Check to see if the excpt.h include file provided contains the + # definition for EXCEPTION_DISPOSITION; if not, which is the case + # with Cygwin's version as of 2002-04-10, define it to be int, + # sufficient for getting the current code to work. + # + echo "$as_me:$LINENO: checking for EXCEPTION_DISPOSITION support in include files" >&5 +echo $ECHO_N "checking for EXCEPTION_DISPOSITION support in include files... $ECHO_C" >&6 +if test "${tcl_cv_eh_disposition+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +# define WIN32_LEAN_AND_MEAN +# include <windows.h> +# undef WIN32_LEAN_AND_MEAN + +int +main () +{ + + EXCEPTION_DISPOSITION x; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_eh_disposition=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_eh_disposition=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $tcl_cv_eh_disposition" >&5 +echo "${ECHO_T}$tcl_cv_eh_disposition" >&6 + if test "$tcl_cv_eh_disposition" = "no" ; then + +cat >>confdefs.h <<\_ACEOF +#define EXCEPTION_DISPOSITION int +_ACEOF + + fi + + # Check to see if winnt.h defines CHAR, SHORT, and LONG + # even if VOID has already been #defined. The win32api + # used by mingw and cygwin is known to do this. + + echo "$as_me:$LINENO: checking for winnt.h that ignores VOID define" >&5 +echo $ECHO_N "checking for winnt.h that ignores VOID define... $ECHO_C" >&6 +if test "${tcl_cv_winnt_ignore_void+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + #define VOID void + #define WIN32_LEAN_AND_MEAN + #include <windows.h> + #undef WIN32_LEAN_AND_MEAN + +int +main () +{ + + CHAR c; + SHORT s; + LONG l; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_winnt_ignore_void=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_winnt_ignore_void=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $tcl_cv_winnt_ignore_void" >&5 +echo "${ECHO_T}$tcl_cv_winnt_ignore_void" >&6 + if test "$tcl_cv_winnt_ignore_void" = "yes" ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_WINNT_IGNORE_VOID 1 +_ACEOF + + fi + + # See if the compiler supports casting to a union type. + # This is used to stop gcc from printing a compiler + # warning when initializing a union member. + + echo "$as_me:$LINENO: checking for cast to union support" >&5 +echo $ECHO_N "checking for cast to union support... $ECHO_C" >&6 +if test "${tcl_cv_cast_to_union+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + union foo { int i; double d; }; + union foo f = (union foo) (int) 0; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_cast_to_union=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cast_to_union=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $tcl_cv_cast_to_union" >&5 +echo "${ECHO_T}$tcl_cv_cast_to_union" >&6 + if test "$tcl_cv_cast_to_union" = "yes"; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_CAST_TO_UNION 1 +_ACEOF + + fi + fi + # DL_LIBS is empty, but then we match the Unix version @@ -4096,7 +4540,7 @@ fi echo "$as_me:$LINENO: checking availability of _strtoi64" >&5 echo $ECHO_N "checking availability of _strtoi64... $ECHO_C" >&6 -if test "${tcl_have_strtoi64+set}" = set; then +if test "${tcl_cv_strtoi64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4137,19 +4581,19 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - tcl_have_strtoi64=yes + tcl_cv_strtoi64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -tcl_have_strtoi64=no +tcl_cv_strtoi64=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $tcl_have_strtoi64" >&5 -echo "${ECHO_T}$tcl_have_strtoi64" >&6 -if test $tcl_have_strtoi64 = no; then +echo "$as_me:$LINENO: result: $tcl_cv_strtoi64" >&5 +echo "${ECHO_T}$tcl_cv_strtoi64" >&6 +if test $tcl_cv_strtoi64 = no; then cat >>confdefs.h <<\_ACEOF #define NO_STRTOI64 1 @@ -4299,6 +4743,11 @@ fi; CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)' DBGX="" + +cat >>confdefs.h <<\_ACEOF +#define NDEBUG 1 +_ACEOF + echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 @@ -4323,18 +4772,21 @@ _ACEOF if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define TCL_MEM_DEBUG 1 _ACEOF fi if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define TCL_COMPILE_DEBUG 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define TCL_COMPILE_STATS 1 _ACEOF @@ -4412,98 +4864,6 @@ echo "${ECHO_T}$result" >&6 -#-------------------------------------------------------------------- -# Locate and source the tclConfig.sh file. -#-------------------------------------------------------------------- - - - echo "$as_me:$LINENO: checking the location of tclConfig.sh" >&5 -echo $ECHO_N "checking the location of tclConfig.sh... $ECHO_C" >&6 - - if test -d ../../tcl8.6$TK_PATCH_LEVEL/win; then - TCL_BIN_DIR_DEFAULT=../../tcl8.6$TK_PATCH_LEVEL/win - elif test -d ../../tcl8.6/win; then - TCL_BIN_DIR_DEFAULT=../../tcl8.6/win - else - TCL_BIN_DIR_DEFAULT=../../tcl/win - fi - - -# Check whether --with-tcl or --without-tcl was given. -if test "${with_tcl+set}" = set; then - withval="$with_tcl" - TCL_BIN_DIR=$withval -else - TCL_BIN_DIR=`cd $TCL_BIN_DIR_DEFAULT; pwd` -fi; - if test ! -d $TCL_BIN_DIR; then - { { echo "$as_me:$LINENO: error: Tcl directory $TCL_BIN_DIR does not exist" >&5 -echo "$as_me: error: Tcl directory $TCL_BIN_DIR does not exist" >&2;} - { (exit 1); exit 1; }; } - fi - if test ! -f $TCL_BIN_DIR/tclConfig.sh; then - { { echo "$as_me:$LINENO: 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?" >&5 -echo "$as_me: 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?" >&2;} - { (exit 1); exit 1; }; } - fi - echo "$as_me:$LINENO: result: $TCL_BIN_DIR/tclConfig.sh" >&5 -echo "${ECHO_T}$TCL_BIN_DIR/tclConfig.sh" >&6 - - - echo "$as_me:$LINENO: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 -echo $ECHO_N "checking for existence of $TCL_BIN_DIR/tclConfig.sh... $ECHO_C" >&6 - - if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then - echo "$as_me:$LINENO: result: loading" >&5 -echo "${ECHO_T}loading" >&6 - . $TCL_BIN_DIR/tclConfig.sh - else - echo "$as_me:$LINENO: result: file not found" >&5 -echo "${ECHO_T}file not found" >&6 - fi - - # - # If the TCL_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable TCL_LIB_SPEC will be set to the value - # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC - # instead of TCL_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - # - - if test -f $TCL_BIN_DIR/Makefile ; then - TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} - TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} - TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} - fi - - # - # eval is required to do the TCL_DBGX substitution - # - - eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" - eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" - eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" - - eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" - eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" - eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" - - - - - - - - - - - - - - - - echo "$as_me:$LINENO: checking for tclsh in Tcl build directory" >&5 echo $ECHO_N "checking for tclsh in Tcl build directory... $ECHO_C" >&6 @@ -5360,6 +5720,16 @@ s,@RC@,$RC,;t t s,@ac_ct_RC@,$ac_ct_RC,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@TCL_THREADS@,$TCL_THREADS,;t t +s,@TCL_VERSION@,$TCL_VERSION,;t t +s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t +s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t +s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t +s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t +s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t +s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t +s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t +s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t +s,@TCL_DEFS@,$TCL_DEFS,;t t s,@CYGPATH@,$CYGPATH,;t t s,@CELIB_DIR@,$CELIB_DIR,;t t s,@DL_LIBS@,$DL_LIBS,;t t @@ -5371,16 +5741,6 @@ s,@CFLAGS_DEFAULT@,$CFLAGS_DEFAULT,;t t s,@LDFLAGS_DEFAULT@,$LDFLAGS_DEFAULT,;t t s,@VC_MANIFEST_EMBED_DLL@,$VC_MANIFEST_EMBED_DLL,;t t s,@VC_MANIFEST_EMBED_EXE@,$VC_MANIFEST_EMBED_EXE,;t t -s,@TCL_VERSION@,$TCL_VERSION,;t t -s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t -s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t -s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t -s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t -s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t -s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t -s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t -s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t -s,@TCL_DEFS@,$TCL_DEFS,;t t s,@BUILD_TCLSH@,$BUILD_TCLSH,;t t s,@TCLSH_PROG@,$TCLSH_PROG,;t t s,@TK_WIN_VERSION@,$TK_WIN_VERSION,;t t diff --git a/win/configure.in b/win/configure.in index deed37d..75c9e7a 100644 --- a/win/configure.in +++ b/win/configure.in @@ -55,15 +55,6 @@ AC_CHECK_TOOL(RC, windres) AC_PROG_MAKE_SET #-------------------------------------------------------------------- -# Perform additinal compiler tests. -#-------------------------------------------------------------------- - -dnl Currently AC_CYGWIN is disabled since it invokes AC_CANONICAL_HOST -dnl under autoconf 2.5X. -dnl -dnl AC_CYGWIN - -#-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- @@ -84,6 +75,13 @@ SC_ENABLE_THREADS SC_ENABLE_SHARED #-------------------------------------------------------------------- +# Locate and source the tclConfig.sh file. +#-------------------------------------------------------------------- + +SC_PATH_TCLCONFIG($TK_PATCH_LEVEL) +SC_LOAD_TCLCONFIG + +#-------------------------------------------------------------------- # The statements below define a collection of compile flags. This # macro depends on the value of SHARED_BUILD, and should be called # after SC_ENABLE_SHARED checks the configure switches. @@ -102,11 +100,11 @@ AC_SUBST(MAN2TCLFLAGS) # Check for _strtoi64 #------------------------------------------- -AC_CACHE_CHECK([availability of _strtoi64], tcl_have_strtoi64, [ +AC_CACHE_CHECK([availability of _strtoi64], tcl_cv_strtoi64, [ AC_TRY_LINK([#include <stdlib.h>], [_strtoi64(0,0,0)], - tcl_have_strtoi64=yes, tcl_have_strtoi64=no)]) -if test $tcl_have_strtoi64 = no; then + tcl_cv_strtoi64=yes, tcl_cv_strtoi64=no)]) +if test $tcl_cv_strtoi64 = no; then AC_DEFINE(NO_STRTOI64, 1, [Is _strtoi64 function available?]) fi @@ -137,13 +135,6 @@ TK_DBGX=${DBGX} SC_EMBED_MANIFEST(wish.exe.manifest) -#-------------------------------------------------------------------- -# Locate and source the tclConfig.sh file. -#-------------------------------------------------------------------- - -SC_PATH_TCLCONFIG($TK_PATCH_LEVEL) -SC_LOAD_TCLCONFIG - SC_BUILD_TCLSH SC_PROG_TCLSH @@ -34,7 +34,10 @@ 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` fi AC_MSG_RESULT($TCL_BIN_DIR/tclConfig.sh) ]) @@ -300,6 +303,7 @@ AC_DEFUN([SC_ENABLE_SYMBOLS], [ CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)' DBGX="" + AC_DEFINE(NDEBUG, 1, [Is no debugging enabled?]) AC_MSG_RESULT([no]) AC_DEFINE(TCL_CFG_OPTIMIZED) @@ -316,12 +320,12 @@ AC_DEFUN([SC_ENABLE_SYMBOLS], [ AC_DEFINE(TCL_CFG_DEBUG) if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then - AC_DEFINE(TCL_MEM_DEBUG) + AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?]) fi if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then - AC_DEFINE(TCL_COMPILE_DEBUG) - AC_DEFINE(TCL_COMPILE_STATS) + AC_DEFINE(TCL_COMPILE_DEBUG, 1, [Is bytecode debugging enabled?]) + AC_DEFINE(TCL_COMPILE_STATS, 1, [Are bytecode statistics enabled?]) fi if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then @@ -402,7 +406,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ # Set some defaults (may get changed below) EXTRA_CFLAGS="" - AC_DEFINE(MODULE_SCOPE, [extern], [No need to mark inidividual symbols as hidden]) + AC_DEFINE(MODULE_SCOPE, [extern], [No need to mark inidividual symbols as hidden]) AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo) @@ -412,6 +416,42 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ # which requires x86|amd64|ia64. MACHINE="X86" + if test "$GCC" = "yes"; then + + if test "$TCL_CC" = "gcc"; then + CFLAGS="$CFLAGS -mwin32" + fi + AC_CACHE_CHECK(for cross-compile version of gcc, + ac_cv_cross, + AC_TRY_COMPILE([ + #ifndef __WIN32__ + #error cross-compiler + #endif + ], [], + ac_cv_cross=no, + ac_cv_cross=yes) + ) + + if test "$ac_cv_cross" = "yes"; then + case "$do64bit" in + amd64|x64|yes) + CC="x86_64-w64-mingw32-gcc" + LD="x86_64-w64-mingw32-ld" + AR="x86_64-w64-mingw32-ar" + RANLIB="x86_64-w64-mingw32-ranlib" + RC="x86_64-w64-mingw32-windres" + ;; + *) + CC="i686-w64-mingw32-gcc" + LD="i686-w64-mingw32-ld" + AR="i686-w64-mingw32-ar" + RANLIB="i686-w64-mingw32-ranlib" + RC="i686-w64-mingw32-windres" + ;; + esac + fi + fi + # Check for a bug in gcc's windres that causes the # compile to fail when a Windows native path is # passed into windres. The mingw toolchain requires @@ -437,23 +477,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ cyg_conftest= fi - AC_CACHE_CHECK(for Cygwin version of gcc, - ac_cv_cygwin, - AC_TRY_COMPILE([ - #ifdef __CYGWIN__ - #error cygwin - #endif - ], - [], - ac_cv_cygwin=no, - ac_cv_cygwin=yes) - ) - if test "$ac_cv_cygwin" = "yes" ; then - AC_MSG_WARN([Compiling under Cygwin is not currently supported. -If you are not sure you want this, see the README -file for information about building with Mingw.]) - fi - if test "$CYGPATH" = "echo" || test "$ac_cv_cygwin" = "yes"; then + if test "$CYGPATH" = "echo"; then DEPARG='"$<"' else DEPARG='"$(shell $(CYGPATH) $<)"' @@ -461,6 +485,40 @@ file for information about building with Mingw.]) # set various compiler flags depending on whether we are using gcc or cl + if test "${GCC}" = "yes" ; then + AC_CACHE_CHECK(for mingw32 version of gcc, + ac_cv_win32, + AC_TRY_COMPILE([ + #ifdef __WIN32__ + #error win32 + #endif + ], [], + ac_cv_win32=no, + ac_cv_win32=yes) + ) + if test "$ac_cv_win32" != "yes"; then + AC_MSG_ERROR([${CC} cannot produce win32 executables.]) + fi + + hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -mwindows -municode -Dmain=xxmain" + AC_CACHE_CHECK(for working -municode linker flag, + ac_cv_municode, + AC_TRY_LINK([ + #include <windows.h> + int APIENTRY wWinMain(HINSTANCE a, HINSTANCE b, LPWSTR c, int d) {return 0;} + ], + [], + ac_cv_municode=yes, + ac_cv_municode=no) + ) + CFLAGS=$hold_cflags + if test "$ac_cv_municode" = "yes" ; then + extra_ldflags="$extra_ldflags -municode" + else + extra_cflags="$extra_cflags -DTCL_BROKEN_MAINARGS" + fi + fi + AC_MSG_CHECKING([compiler flags]) if test "${GCC}" = "yes" ; then SHLIB_LD="" @@ -479,41 +537,8 @@ file for information about building with Mingw.]) MAKE_EXE="\${CC} -o \[$]@" LIBPREFIX="lib" - extra_cflags="-pipe" - extra_ldflags="-pipe" - - if test "$ac_cv_cygwin" = "yes"; then - touch ac$$.c - if ${CC} -c -mwin32 ac$$.c >/dev/null 2>&1; then - case "$extra_cflags" in - *-mwin32*) ;; - *) extra_cflags="-mwin32 $extra_cflags" ;; - esac - case "$extra_ldflags" in - *-mwin32*) ;; - *) extra_ldflags="-mwin32 $extra_ldflags" ;; - esac - fi - rm -f ac$$.o ac$$.c - fi - - hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -mwindows -municode -Dmain=xxmain" - AC_CACHE_CHECK(for working -municode linker flag, - ac_cv_municode, - AC_TRY_LINK([ - #include <windows.h> - int APIENTRY wWinMain(HINSTANCE a, HINSTANCE b, LPWSTR c, int d) {return 0;} - ], - [], - ac_cv_municode=yes, - ac_cv_municode=no) - ) - CFLAGS=$hold_cflags - if test "$ac_cv_municode" = "yes" ; then - extra_ldflags="$extra_ldflags -municode" - else - extra_cflags="$extra_cflags -DTCL_BROKEN_MAINARGS" - fi + extra_ldflags="$extra_ldflags -pipe" + extra_cflags="$extra_cflags -pipe" if test "${SHARED_BUILD}" = "0" ; then # static @@ -591,12 +616,12 @@ file for information about building with Mingw.]) ;; *) AC_TRY_COMPILE([ - #ifdef _WIN64 - #error 64-bit - #endif + #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 @@ -820,6 +845,101 @@ file for information about building with Mingw.]) AC_DEFINE(TCL_CFG_DO64BIT) fi + if test "${GCC}" = "yes" ; then + AC_CACHE_CHECK(for SEH support in compiler, + tcl_cv_seh, + AC_TRY_RUN([ + #define WIN32_LEAN_AND_MEAN + #include <windows.h> + #undef WIN32_LEAN_AND_MEAN + + int main(int argc, char** argv) { + int a, b = 0; + __try { + a = 666 / b; + } + __except (EXCEPTION_EXECUTE_HANDLER) { + return 0; + } + return 1; + } + ], + tcl_cv_seh=yes, + tcl_cv_seh=no, + tcl_cv_seh=no) + ) + if test "$tcl_cv_seh" = "no" ; then + AC_DEFINE(HAVE_NO_SEH, 1, + [Defined when mingw does not support SEH]) + fi + + # + # Check to see if the excpt.h include file provided contains the + # definition for EXCEPTION_DISPOSITION; if not, which is the case + # with Cygwin's version as of 2002-04-10, define it to be int, + # sufficient for getting the current code to work. + # + AC_CACHE_CHECK(for EXCEPTION_DISPOSITION support in include files, + tcl_cv_eh_disposition, + AC_TRY_COMPILE([ +# define WIN32_LEAN_AND_MEAN +# include <windows.h> +# undef WIN32_LEAN_AND_MEAN + ],[ + EXCEPTION_DISPOSITION x; + ], + tcl_cv_eh_disposition=yes, + tcl_cv_eh_disposition=no) + ) + if test "$tcl_cv_eh_disposition" = "no" ; then + AC_DEFINE(EXCEPTION_DISPOSITION, int, + [Defined when cygwin/mingw does not support EXCEPTION DISPOSITION]) + fi + + # Check to see if winnt.h defines CHAR, SHORT, and LONG + # even if VOID has already been #defined. The win32api + # used by mingw and cygwin is known to do this. + + AC_CACHE_CHECK(for winnt.h that ignores VOID define, + tcl_cv_winnt_ignore_void, + AC_TRY_COMPILE([ + #define VOID void + #define WIN32_LEAN_AND_MEAN + #include <windows.h> + #undef WIN32_LEAN_AND_MEAN + ], [ + CHAR c; + SHORT s; + LONG l; + ], + tcl_cv_winnt_ignore_void=yes, + tcl_cv_winnt_ignore_void=no) + ) + if test "$tcl_cv_winnt_ignore_void" = "yes" ; then + AC_DEFINE(HAVE_WINNT_IGNORE_VOID, 1, + [Defined when cygwin/mingw ignores VOID define in winnt.h]) + fi + + # See if the compiler supports casting to a union type. + # This is used to stop gcc from printing a compiler + # warning when initializing a union member. + + AC_CACHE_CHECK(for cast to union support, + tcl_cv_cast_to_union, + AC_TRY_COMPILE([], + [ + union foo { int i; double d; }; + union foo f = (union foo) (int) 0; + ], + tcl_cv_cast_to_union=yes, + tcl_cv_cast_to_union=no) + ) + if test "$tcl_cv_cast_to_union" = "yes"; then + AC_DEFINE(HAVE_CAST_TO_UNION, 1, + [Defined when compiler supports casting to union type.]) + fi + fi + # DL_LIBS is empty, but then we match the Unix version AC_SUBST(DL_LIBS) AC_SUBST(CFLAGS_DEBUG) diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c index f770f15..dd482bd 100644 --- a/win/tkWinDraw.c +++ b/win/tkWinDraw.c @@ -23,7 +23,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 */ @@ -54,7 +54,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 */ @@ -92,9 +92,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 cd4094d..580e58f 100644 --- a/win/tkWinInt.h +++ b/win/tkWinInt.h @@ -125,8 +125,8 @@ typedef struct { * Win32 raster and BitBlt op modes. */ -MODULE_SCOPE int tkpWinRopModes[]; -MODULE_SCOPE int tkpWinBltModes[]; +MODULE_SCOPE const int tkpWinRopModes[]; +MODULE_SCOPE const int tkpWinBltModes[]; /* * The following defines are used with TkWinGetBorderPixels to get the extra 2 diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index b1bf7f8..245639d 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.c @@ -235,7 +235,7 @@ GetNewID( } commandEntryPtr = Tcl_CreateHashEntry(&tsdPtr->commandTable, - (char *) curID, &new); + INT2PTR(curID), &new); if (new) { Tcl_SetHashValue(commandEntryPtr, mePtr); *menuIDPtr = curID; diff --git a/xlib/xcolors.c b/xlib/xcolors.c index 11ab6a0..beec321 100644 --- a/xlib/xcolors.c +++ b/xlib/xcolors.c @@ -17,8 +17,8 @@ * Index array. For each of the characters 'a'-'y', this table gives the first color * starting with that character in the xColors table. */ -static int az[] = {0, 5, 13, 21, 45, 45, 49, 59, 61, 64, 64, 65, 89, 104, - 107, 113, 124, 124, 127, 141, 146, 146, 148, 151, 151, 153}; +static int az[] = {0, 5, 13, 21, 45, 46, 50, 60, 62, 65, 66, 67, 91, 106, + 109, 115, 126, 127, 130, 144, 149, 150, 152, 155, 156, 158}; /* * Define an array that defines the mapping from color names to RGB values. @@ -90,6 +90,7 @@ static const elem xColors[] = { "imGrey\0 \151\151\151\0", "odgerBlue\0 \020\116\213\030\164\315\034\206\356\036\220\377\036\220\377\4", /* Colors starting with 'e' */ + "\377" /* placeholder */, /* Colors starting with 'f' */ "irebrick\0 \213\032\032\315\046\046\356\054\054\377\060\060\262\042\042\4", "loralWhite\0 \377\372\360\0", @@ -116,6 +117,7 @@ static const elem xColors[] = { "ndigo\0 \113\000\202\0", "vory\0 \213\213\203\315\315\301\356\356\340\377\377\360\377\377\360\4", /* Colors starting with 'j' */ + "\377" /* placeholder */, /* Colors starting with 'k' */ "haki\0 \213\206\116\315\306\163\356\346\205\377\366\217\360\346\214\4", /* Colors starting with 'l' */ @@ -183,6 +185,7 @@ static const elem xColors[] = { "owderBlue\0 \260\340\346\0", "urple\0 \125\032\213\175\046\315\221\054\356\233\060\377\200\000\200\4", /* Colors starting with 'q' */ + "\377" /* placeholder */, /* Colors starting with 'r' */ "ed\0 \213\000\000\315\000\000\356\000\000\377\000\000\377\000\000\4", "osyBrown\0 \213\151\151\315\233\233\356\264\264\377\301\301\274\217\217\4", @@ -209,6 +212,7 @@ static const elem xColors[] = { "omato\0 \213\066\046\315\117\071\356\134\102\377\143\107\377\143\107\4", "urquoise\0 \000\206\213\000\305\315\000\345\356\000\365\377\100\340\320\4", /* Colors starting with 'u' */ + "\377" /* placeholder */, /* Colors starting with 'v' */ "iolet\0 \356\202\356\0", "ioletRed\0 \213\042\122\315\062\170\356\072\214\377\076\226\320\040\220\4", @@ -217,6 +221,7 @@ static const elem xColors[] = { "hite\0 \377\377\377\0", "hiteSmoke\0 \365\365\365\0", /* Colors starting with 'x' */ + "\377" /* placeholder */, /* Colors starting with 'y' */ "ellow\0 \213\213\000\315\315\000\356\356\000\377\377\000\377\377\000\4", "ellowGreen\0 \232\315\062\0" @@ -238,7 +243,7 @@ static const elem xColors[] = { *---------------------------------------------------------------------- */ -#ifdef __WIN32__ +#if defined(__WIN32__) && !defined(__CYGWIN__) # ifdef NO_STRTOI64 /* This version only handles hex-strings without 0x prefix */ static __int64 @@ -359,7 +364,7 @@ XParseColor( * p = pointer to current element being considered. */ int r = (spec[0] - 'A') & 0xdf; - if (r > (sizeof(az)/sizeof(az[0] - 1))) { + if (r >= (int) sizeof(az) - 1) { return 0; } size = az[r + 1] - az[r]; |