diff options
-rw-r--r-- | ChangeLog | 17 | ||||
-rw-r--r-- | generic/tclAlloc.c | 20 | ||||
-rw-r--r-- | generic/tclBasic.c | 11 | ||||
-rw-r--r-- | generic/tclPkgConfig.c | 4 | ||||
-rw-r--r-- | library/dde/pkgIndex.tcl | 4 | ||||
-rwxr-xr-x | library/reg/pkgIndex.tcl | 4 | ||||
-rw-r--r-- | tests/async.test | 4 | ||||
-rw-r--r-- | tests/platform.test | 2 | ||||
-rw-r--r-- | tests/unixNotfy.test | 2 | ||||
-rwxr-xr-x | unix/configure | 11 | ||||
-rw-r--r-- | unix/tcl.m4 | 3 | ||||
-rw-r--r-- | unix/tclConfig.h.in | 2 | ||||
-rwxr-xr-x | win/configure | 32 | ||||
-rw-r--r-- | win/makefile.bc | 2 | ||||
-rw-r--r-- | win/rules.vc | 2 | ||||
-rw-r--r-- | win/tcl.m4 | 27 |
16 files changed, 75 insertions, 72 deletions
@@ -1,3 +1,20 @@ +2012-04-11 Jan Nijtmans <nijtmans@users.sf.net> + + * win/tclWinInit.c: [Bug 3448512]: clock scan "1958-01-01" fails only + * win/tcl.m4: in debug compilation. + * win/configure: + * unix/tcl.m4: Use NDEBUG consistantly meaning: no debugging. + * unix/configure: + * generic/tclBasic.c: + * library/dde/pkgIndex.tcl Use [::tcl::pkgconfig get debug] in stead + * library/reg/pkgIndex.tcl of [info exists ::tcl_platform(debug)] + + ***POTENTIAL INCOMPATIBILITY*** + The variables $tcl_platform(debug) and $tcl_platform(threaded) no longer + exist. They don't belong in the tcl_platform array, were never documented, + disturbed the platform-1.1 test, $tcl_platform(debug) was only available + on Windows anyway, and TIP #59 provides a much better alternative. + 2012-04-10 Donal K. Fellows <dkf@users.sf.net> * generic/tcl.h (TCL_DEPRECATED_API): [Bug 2458976]: Added macro that diff --git a/generic/tclAlloc.c b/generic/tclAlloc.c index 6fff92b..ae61e85 100644 --- a/generic/tclAlloc.c +++ b/generic/tclAlloc.c @@ -26,12 +26,6 @@ #if USE_TCLALLOC -#ifdef TCL_DEBUG -# define DEBUG -/* #define MSTATS */ -# define RCHECK -#endif - /* * We should really make use of AC_CHECK_TYPE(caddr_t) here, but it can wait * until Tcl uses config.h properly. @@ -60,7 +54,7 @@ union overhead { unsigned char index; /* bucket # */ unsigned char unused; /* unused */ unsigned char magic1; /* other magic number */ -#ifdef RCHECK +#ifndef NDEBUG unsigned short rmagic; /* range magic number */ unsigned long size; /* actual block size */ unsigned short unused2; /* padding to 8-byte align */ @@ -77,7 +71,7 @@ union overhead { #define MAGIC 0xef /* magic # on accounting info */ #define RMAGIC 0x5555 /* magic # on range info */ -#ifdef RCHECK +#ifndef NDEBUG #define RSLOP sizeof(unsigned short) #else #define RSLOP 0 @@ -142,7 +136,7 @@ static int allocInit = 0; static unsigned int numMallocs[NBUCKETS+1]; #endif -#if defined(DEBUG) || defined(RCHECK) +#if !defined(NDEBUG) #define ASSERT(p) if (!(p)) Tcl_Panic(# p) #define RANGE_ASSERT(p) if (!(p)) Tcl_Panic(# p) #else @@ -299,7 +293,7 @@ TclpAlloc( numMallocs[NBUCKETS]++; #endif -#ifdef RCHECK +#ifndef NDEBUG /* * Record allocated size of block and bound space with magic numbers. */ @@ -357,7 +351,7 @@ TclpAlloc( numMallocs[bucket]++; #endif -#ifdef RCHECK +#ifndef NDEBUG /* * Record allocated size of block and bound space with magic numbers. */ @@ -577,7 +571,7 @@ TclpRealloc( numMallocs[NBUCKETS]++; #endif -#ifdef RCHECK +#ifndef NDEBUG /* * Record allocated size of block and update magic number bounds. */ @@ -619,7 +613,7 @@ TclpRealloc( * Ok, we don't have to copy, it fits as-is */ -#ifdef RCHECK +#ifndef NDEBUG overPtr->realBlockSize = (numBytes + RSLOP - 1) & ~(RSLOP - 1); BLOCK_END(overPtr) = RMAGIC; #endif diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 280290c..8905849 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -928,17 +928,6 @@ Tcl_CreateInterp(void) TclPrecTraceProc, NULL); TclpSetVariables(interp); -#ifdef TCL_THREADS - /* - * The existence of the "threaded" element of the tcl_platform array - * indicates that this particular Tcl shell has been compiled with threads - * turned on. Using "info exists tcl_platform(threaded)" a Tcl script can - * introspect on the interpreter level of thread safety. - */ - - Tcl_SetVar2(interp, "tcl_platform", "threaded", "1", TCL_GLOBAL_ONLY); -#endif - /* * Register Tcl's version number. * TIP #268: Full patchlevel instead of just major.minor diff --git a/generic/tclPkgConfig.c b/generic/tclPkgConfig.c index 5907a03..466d535 100644 --- a/generic/tclPkgConfig.c +++ b/generic/tclPkgConfig.c @@ -22,7 +22,7 @@ * - TCL_COMPILE_STATS OSCMa bytecode compiler statistics. * * - TCL_CFG_DO64BIT NSCMdt tcl is compiled for a 64bit system. - * - TCL_CFG_DEBUG NSCMdt tcl is compiled with symbol info on. + * - NDEBUG NSCMdt tcl is compiled with symbol info off. * - TCL_CFG_OPTIMIZED NSCMdt tcl is compiled with cc optimizations on * - TCL_CFG_PROFILED NSCMdt tcl is compiled with profiling info. * @@ -70,7 +70,7 @@ # define CFG_64 "0" #endif -#ifdef TCL_CFG_DEBUG +#ifndef NDEBUG # define CFG_DEBUG "1" #else # define CFG_DEBUG "0" diff --git a/library/dde/pkgIndex.tcl b/library/dde/pkgIndex.tcl index 3125ada..194e4cd 100644 --- a/library/dde/pkgIndex.tcl +++ b/library/dde/pkgIndex.tcl @@ -1,6 +1,6 @@ -if {![package vsatisfies [package provide Tcl] 8]} {return} +if {![package vsatisfies [package provide Tcl] 8.5]} {return} if {[string compare $::tcl_platform(platform) windows]} {return} -if {[info exists ::tcl_platform(debug)]} { +if {[::tcl::pkgconfig get debug]} { package ifneeded dde 1.3.2 [list load [file join $dir tcldde13g.dll] dde] } else { package ifneeded dde 1.3.2 [list load [file join $dir tcldde13.dll] dde] diff --git a/library/reg/pkgIndex.tcl b/library/reg/pkgIndex.tcl index f07dee4..92335f3 100755 --- a/library/reg/pkgIndex.tcl +++ b/library/reg/pkgIndex.tcl @@ -1,6 +1,6 @@ -if {![package vsatisfies [package provide Tcl] 8]} {return} +if {![package vsatisfies [package provide Tcl] 8.5]} {return} if {[string compare $::tcl_platform(platform) windows]} {return} -if {[info exists ::tcl_platform(debug)]} { +if {[::tcl::pkgconfig get debug]} { package ifneeded registry 1.3 \ [list load [file join $dir tclreg13g.dll] registry] } else { diff --git a/tests/async.test b/tests/async.test index 7834ed5..35dda88 100644 --- a/tests/async.test +++ b/tests/async.test @@ -17,9 +17,7 @@ if {[lsearch [namespace children] ::tcltest] == -1} { } testConstraint testasync [llength [info commands testasync]] -testConstraint threaded [expr { - [info exists ::tcl_platform(threaded)] && $::tcl_platform(threaded) -}] +testConstraint threaded [::tcl::pkgconfig get threaded] proc async1 {result code} { global aresult acode diff --git a/tests/platform.test b/tests/platform.test index 8cb8dcd..33c96ba 100644 --- a/tests/platform.test +++ b/tests/platform.test @@ -18,8 +18,6 @@ testConstraint testWinCPUID [llength [info commands testwincpuid]] test platform-1.1 {TclpSetVariables: tcl_platform} { interp create i - i eval {catch {unset tcl_platform(debug)}} - i eval {catch {unset tcl_platform(threaded)}} set result [i eval {lsort [array names tcl_platform]}] interp delete i set result diff --git a/tests/unixNotfy.test b/tests/unixNotfy.test index 067d225..0646a3d 100644 --- a/tests/unixNotfy.test +++ b/tests/unixNotfy.test @@ -20,7 +20,7 @@ testConstraint noTk [expr {0 != [catch {package present Tk}]}] testConstraint thread [expr {0 == [catch {package require Thread 2.6}]}] # Darwin always uses a threaded notifier testConstraint unthreaded [expr { - (![info exist tcl_platform(threaded)] || !$tcl_platform(threaded)) + ![::tcl::pkgconfig get threaded] && $tcl_platform(os) ne "Darwin" }] diff --git a/unix/configure b/unix/configure index 64ff7e6..d87b633 100755 --- a/unix/configure +++ b/unix/configure @@ -9319,6 +9319,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 @@ -9336,12 +9341,6 @@ echo "${ECHO_T}yes (standard debugging)" >&6 fi - ### FIXME: Surely TCL_CFG_DEBUG should be set to whether we're debugging? - -cat >>confdefs.h <<\_ACEOF -#define TCL_CFG_DEBUG 1 -_ACEOF - if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 74a577d..222c375 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 @@ -749,8 +750,6 @@ AC_DEFUN([SC_ENABLE_SYMBOLS], [ fi AC_SUBST(CFLAGS_DEFAULT) AC_SUBST(LDFLAGS_DEFAULT) - ### FIXME: Surely TCL_CFG_DEBUG should be set to whether we're debugging? - AC_DEFINE(TCL_CFG_DEBUG, 1, [Is debugging enabled?]) if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?]) diff --git a/unix/tclConfig.h.in b/unix/tclConfig.h.in index 42abf34..31466bc 100644 --- a/unix/tclConfig.h.in +++ b/unix/tclConfig.h.in @@ -362,7 +362,7 @@ #undef TCL_CFGVAL_ENCODING /* Is debugging enabled? */ -#undef TCL_CFG_DEBUG +#undef NDEBUG /* Is this a 64-bit build? */ #undef TCL_CFG_DO64BIT diff --git a/win/configure b/win/configure index aa153a2..f3bd0d9 100755 --- a/win/configure +++ b/win/configure @@ -3336,7 +3336,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - #ifdef __WIN32__ + #ifndef __WIN32__ #error cross-compiler #endif @@ -3370,12 +3370,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_cross=yes + ac_cv_cross=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_cross=no +ac_cv_cross=yes fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext @@ -3687,8 +3687,8 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - #ifdef _WIN64 - #error 64-bit + #ifndef _WIN64 + #error 32-bit #endif int @@ -3721,12 +3721,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 @@ -4966,6 +4966,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 @@ -4984,24 +4989,23 @@ echo "${ECHO_T}yes (standard debugging)" >&6 fi - cat >>confdefs.h <<\_ACEOF -#define TCL_CFG_DEBUG 1 -_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 diff --git a/win/makefile.bc b/win/makefile.bc index 12ba603..338205e 100644 --- a/win/makefile.bc +++ b/win/makefile.bc @@ -136,7 +136,7 @@ BINROOT = .. !IF "$(NODEBUG)" == "1" TMPDIRNAME = Release DBGX = -SYMDEFINES = +SYMDEFINES = -DNDEBUG !ELSE TMPDIRNAME = Debug #DBGX = d diff --git a/win/rules.vc b/win/rules.vc index 01e44e0..316dc05 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -477,6 +477,8 @@ OPTDEFINES = $(OPTDEFINES) -DTCL_NO_DEPRECATED OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DEBUG !elseif $(OPTIMIZING) OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_OPTIMIZED +!else +OPTDEFINES = $(OPTDEFINES) -DNDEBUG !endif !if $(PROFILE) OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_PROFILED @@ -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) @@ -313,15 +317,14 @@ AC_DEFUN([SC_ENABLE_SYMBOLS], [ fi AC_SUBST(CFLAGS_DEFAULT) AC_SUBST(LDFLAGS_DEFAULT) - 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 @@ -417,12 +420,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 @@ -609,12 +612,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 |