From 8c50e685b1bb9cebcf69e1bc5af874a5f2898547 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 16 Jun 2011 11:51:26 +0000 Subject: Sync with win/tcl.m4 from Tcl --- ChangeLog | 5 +++++ win/configure | 64 +++++++++++++++++++++++++++++++++++++++++++---------------- win/tcl.m4 | 15 ++++++++++++++ 3 files changed, 67 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index a6495e1..df1fe92 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-06-16 Jan Nijtmans + + * win/tcl.m4: Sync with win/tcl.m4 from Tcl + * win/configure: (regenerated) + 2011-06-10 Don Porter * generic/tkCanvLine.c: [Bug 3175610] Incomplete refresh of line item. diff --git a/win/configure b/win/configure index 92b5873..18a1f7d 100755 --- a/win/configure +++ b/win/configure @@ -1370,6 +1370,36 @@ echo "configure:1262: checking compiler flags" >&5 MACHINE="IA64" echo "$ac_t"" Using 64-bit $MACHINE mode" 1>&6 ;; + *) + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + tcl_win_64bit=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + tcl_win_64bit=yes + +fi +rm -f conftest* + if test "$tcl_win_64bit" = "yes" ; then + do64bit=amd64 + MACHINE="AMD64" + echo "$ac_t"" Using 64-bit $MACHINE mode" 1>&6 + fi + ;; esac else if test "${SHARED_BUILD}" = "0" ; then @@ -1603,7 +1633,7 @@ EOF #-------------------------------------------------------------------- echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1607: checking how to run the C preprocessor" >&5 +echo "configure:1637: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1618,13 +1648,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1628: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1658: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1635,13 +1665,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1645: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1675: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1652,13 +1682,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1662: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1684,17 +1714,17 @@ echo "$ac_t""$CPP" 1>&6 ac_safe=`echo "errno.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for errno.h""... $ac_c" 1>&6 -echo "configure:1688: checking for errno.h" >&5 +echo "configure:1718: checking for errno.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1698: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1728: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1726,7 +1756,7 @@ fi echo $ac_n "checking for build with symbols""... $ac_c" 1>&6 -echo "configure:1730: checking for build with symbols" >&5 +echo "configure:1760: checking for build with symbols" >&5 # Check whether --enable-symbols or --disable-symbols was given. if test "${enable_symbols+set}" = set; then enableval="$enable_symbols" @@ -1787,7 +1817,7 @@ TK_DBGX=${DBGX} echo $ac_n "checking whether to embed manifest""... $ac_c" 1>&6 -echo "configure:1791: checking whether to embed manifest" >&5 +echo "configure:1821: checking whether to embed manifest" >&5 # Check whether --enable-embedded-manifest or --disable-embedded-manifest was given. if test "${enable_embedded_manifest+set}" = set; then enableval="$enable_embedded_manifest" @@ -1804,7 +1834,7 @@ fi -a "$GCC" != "yes" ; then # Add the magic to embed the manifest into the dll/exe cat > conftest.$ac_ext <= 1400 @@ -1841,7 +1871,7 @@ rm -f conftest* echo $ac_n "checking the location of tclConfig.sh""... $ac_c" 1>&6 -echo "configure:1845: checking the location of tclConfig.sh" >&5 +echo "configure:1875: checking the location of tclConfig.sh" >&5 if test -d ../../tcl8.4$TK_PATCH_LEVEL/win; then TCL_BIN_DIR_DEFAULT=../../tcl8.4$TK_PATCH_LEVEL/win @@ -1869,7 +1899,7 @@ fi echo $ac_n "checking for existence of $TCL_BIN_DIR/tclConfig.sh""... $ac_c" 1>&6 -echo "configure:1873: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 +echo "configure:1903: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then echo "$ac_t""loading" 1>&6 @@ -1922,14 +1952,14 @@ echo "configure:1873: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 echo $ac_n "checking for tclsh in Tcl build directory""... $ac_c" 1>&6 -echo "configure:1926: checking for tclsh in Tcl build directory" >&5 +echo "configure:1956: checking for tclsh in Tcl build directory" >&5 BUILD_TCLSH=${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT} echo "$ac_t""$BUILD_TCLSH" 1>&6 echo $ac_n "checking for tclsh""... $ac_c" 1>&6 -echo "configure:1933: checking for tclsh" >&5 +echo "configure:1963: checking for tclsh" >&5 if eval "test \"`echo '$''{'ac_cv_path_tclsh'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 diff --git a/win/tcl.m4 b/win/tcl.m4 index a766b7c..26a7036 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -553,6 +553,21 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ MACHINE="IA64" AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) ;; + *) + AC_TRY_COMPILE([ + #ifdef _WIN64 + #error 64-bit + #endif + ], [], + tcl_win_64bit=no, + tcl_win_64bit=yes + ) + if test "$tcl_win_64bit" = "yes" ; then + do64bit=amd64 + MACHINE="AMD64" + AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) + fi + ;; esac else if test "${SHARED_BUILD}" = "0" ; then -- cgit v0.12 From 07169bb2f60d244e9083a77c24fff0f964502568 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 16 Jun 2011 20:27:22 +0000 Subject: New attempt to fix Bug 3062331 --- generic/ttk/ttkTrace.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/generic/ttk/ttkTrace.c b/generic/ttk/ttkTrace.c index 0128a1d..a469d0b 100644 --- a/generic/ttk/ttkTrace.c +++ b/generic/ttk/ttkTrace.c @@ -44,6 +44,11 @@ VarTraceProc( * If the variable is being unset, then re-establish the trace: */ if (flags & TCL_TRACE_DESTROYED) { + if (tracePtr->interp == NULL) { + Tcl_DecrRefCount(tracePtr->varnameObj); + ckfree((ClientData)tracePtr); + return NULL; + } Tcl_TraceVar(interp, name, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, VarTraceProc, clientData); @@ -104,6 +109,18 @@ Ttk_TraceHandle *Ttk_TraceVariable( void Ttk_UntraceVariable(Ttk_TraceHandle *h) { if (h) { + ClientData cd = NULL; + + while ((cd = Tcl_VarTraceInfo(h->interp, Tcl_GetString(h->varnameObj), + 0, VarTraceProc, cd)) != NULL) { + if (cd == (ClientData) h) { + break; + } + } + if (cd == NULL) { + h->interp = NULL; + return; + } Tcl_UntraceVar(h->interp, Tcl_GetString(h->varnameObj), TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, VarTraceProc, (ClientData)h); -- cgit v0.12 From d96f0a1840e687316f7fb0d8153862a1ae684240 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 17 Jun 2011 18:06:52 +0000 Subject: Add comments explaining new code. --- generic/ttk/ttkTrace.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/generic/ttk/ttkTrace.c b/generic/ttk/ttkTrace.c index a469d0b..f171f3d 100644 --- a/generic/ttk/ttkTrace.c +++ b/generic/ttk/ttkTrace.c @@ -44,6 +44,11 @@ VarTraceProc( * If the variable is being unset, then re-establish the trace: */ if (flags & TCL_TRACE_DESTROYED) { + /* + * If a prior call to Ttk_UntraceVariable() left behind an + * indicator that we wanted this handler to be deleted (see below), + * cleanup the ClientData bits and exit. + */ if (tracePtr->interp == NULL) { Tcl_DecrRefCount(tracePtr->varnameObj); ckfree((ClientData)tracePtr); @@ -111,12 +116,36 @@ void Ttk_UntraceVariable(Ttk_TraceHandle *h) if (h) { ClientData cd = NULL; + /* + * Workaround for Tcl Bug 3062331. The trace design problem is + * that when variable unset traces fire, Tcl documents that the + * traced variable has already been unset. It's already gone. + * So from within an unset trace, if you try to call + * Tcl_UntraceVar() on that variable, it will do nothing, because + * the variable by that name can no longer be found. It's gone. + * This means callers of Tcl_UntraceVar() that might be running + * in response to an unset trace have to handle the possibility + * that their Tcl_UntraceVar() call will do nothing. In this case, + * we have to support the possibility that Tcl_UntraceVar() will + * leave the trace in place, so we need to leave the ClientData + * untouched so when that trace does fire it will not crash. + */ + + /* + * Search the traces on the variable to see if the one we are tasked + * with removing is present. + */ while ((cd = Tcl_VarTraceInfo(h->interp, Tcl_GetString(h->varnameObj), 0, VarTraceProc, cd)) != NULL) { if (cd == (ClientData) h) { break; } } + /* + * If the trace we wish to delete is not visible, Tcl_UntraceVar + * will do nothing, so don't try to call it. Instead set an + * indicator in the Ttk_TraceHandle that we need to cleanup later. + */ if (cd == NULL) { h->interp = NULL; return; -- cgit v0.12