diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-01-25 14:20:00 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-01-25 14:20:00 (GMT) |
commit | 034055be09a66ca16385cc4b9e243179d66f075a (patch) | |
tree | 5bcbe2710643cbc972469e1c235b626143462457 | |
parent | 6343dec19ea154b946544b6b419e0eec0e9ad006 (diff) | |
parent | 2ad8238512c29b86039ba28d5e489ffd77069793 (diff) | |
download | tcl-034055be09a66ca16385cc4b9e243179d66f075a.zip tcl-034055be09a66ca16385cc4b9e243179d66f075a.tar.gz tcl-034055be09a66ca16385cc4b9e243179d66f075a.tar.bz2 |
merge core-8-4-branch
-rw-r--r-- | generic/tcl.h | 15 | ||||
-rw-r--r-- | generic/tclBasic.c | 3 | ||||
-rw-r--r-- | generic/tclCkalloc.c | 4 | ||||
-rw-r--r-- | generic/tclExecute.c | 3 | ||||
-rw-r--r-- | generic/tclFileName.c | 4 | ||||
-rw-r--r-- | generic/tclIndexObj.c | 6 | ||||
-rw-r--r-- | generic/tclStubLib.c | 13 | ||||
-rw-r--r-- | unix/tclUnixCompat.c | 7 | ||||
-rwxr-xr-x | win/configure | 68 |
9 files changed, 82 insertions, 41 deletions
diff --git a/generic/tcl.h b/generic/tcl.h index 5f47734..196468a 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -2307,18 +2307,15 @@ typedef unsigned short Tcl_UniChar; * linked into an application. */ -EXTERN CONST char * Tcl_InitStubs _ANSI_ARGS_((Tcl_Interp *interp, - CONST char *version, int exact)); - -#ifndef USE_TCL_STUBS - -/* - * When not using stubs, make it a macro. - */ +EXTERN CONST char *Tcl_InitStubs _ANSI_ARGS_((Tcl_Interp *interp, + CONST char *version, int exact, CONST char *tclversion, int magic)); +#ifdef USE_TCL_STUBS +#define Tcl_InitStubs(interp, version, exact) \ + (Tcl_InitStubs)((interp), (version), (exact)|(int)sizeof(int), TCL_VERSION, TCL_STUB_MAGIC) +#else #define Tcl_InitStubs(interp, version, exact) \ Tcl_PkgRequire(interp, "Tcl", version, exact) - #endif diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 134deac..ced89b4 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -624,7 +624,8 @@ Tcl_CreateInterp() #ifdef Tcl_InitStubs #undef Tcl_InitStubs #endif - Tcl_InitStubs(interp, TCL_VERSION, 1); + Tcl_InitStubs(interp, TCL_VERSION, 1|(int)sizeof(int), TCL_VERSION, + TCL_STUB_MAGIC); return interp; } diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c index a9d98ec..6de9720 100644 --- a/generic/tclCkalloc.c +++ b/generic/tclCkalloc.c @@ -149,6 +149,10 @@ TclInitDbCkalloc() if (!ckallocInit) { ckallocInit = 1; ckallocMutexPtr = Tcl_GetAllocMutex(); +#ifndef TCL_THREADS + /* Silence compiler warning */ + (void)ckallocMutexPtr; +#endif } } diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 2a9f8bb..c09b73e 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -5118,6 +5118,9 @@ VerifyExprObjType(interp, objPtr) long i; Tcl_WideInt w; GET_WIDE_OR_INT(result, objPtr, i, w); + /* Quiet cranky old compilers that complain about + * setting i, but not using it. */ + (void)i; } else { double d; result = Tcl_GetDoubleFromObj((Tcl_Interp *) NULL, objPtr, &d); diff --git a/generic/tclFileName.c b/generic/tclFileName.c index 046eaef..bcaadd4 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.c @@ -1784,13 +1784,17 @@ TclDoGlob(interp, separators, headPtr, tail, types) int baseLength, quoted, count; int result = TCL_OK; char *name, *p, *openBrace, *closeBrace, *firstSpecialChar, savedChar; + /* char lastChar = 0; + */ int length = Tcl_DStringLength(headPtr); + /* if (length > 0) { lastChar = Tcl_DStringValue(headPtr)[length-1]; } + */ /* * Consume any leading directory separators, leaving tail pointing diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c index cc50fd3..0103cdb 100644 --- a/generic/tclIndexObj.c +++ b/generic/tclIndexObj.c @@ -144,7 +144,7 @@ Tcl_GetIndexFromObj(interp, objPtr, tablePtr, msg, flags, indexPtr) * returned and an error message is left in interp's result (unless * interp is NULL). The msg argument is used in the error * message; for example, if msg has the value "option" then the - * error message will say something flag 'bad option "foo": must be + * error message will say something like 'bad option "foo": must be * ...' * * Side effects: @@ -176,6 +176,10 @@ Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, offset, msg, flags, Tcl_Obj *resultPtr; IndexRep *indexRep; + /* Protect against invalid values, like -1 or 0. */ + if (offset < (int)sizeof(char *)) { + offset = (int)sizeof(char *); + } /* * See if there is a valid cached result from a previous lookup. */ diff --git a/generic/tclStubLib.c b/generic/tclStubLib.c index 7b62f5e..7852fa0 100644 --- a/generic/tclStubLib.c +++ b/generic/tclStubLib.c @@ -44,10 +44,12 @@ TclIntPlatStubs *tclIntPlatStubsPtr = NULL; */ #undef Tcl_InitStubs CONST char * -Tcl_InitStubs(interp, version, exact) +Tcl_InitStubs(interp, version, exact, tclversion, magic) Tcl_Interp *interp; CONST char *version; int exact; + CONST char *tclversion; /* not used */ + int magic; /* not used */ { Interp *iPtr = (Interp *) interp; CONST char *actualVersion = NULL; @@ -70,7 +72,7 @@ Tcl_InitStubs(interp, version, exact) if (actualVersion == NULL) { return NULL; } - if (exact) { + if (exact&1) { CONST char *p = version; int count = 0; @@ -96,6 +98,13 @@ Tcl_InitStubs(interp, version, exact) } } } + + if (stubsPtr->tcl_Backslash == NULL) { + stubsPtr->tcl_AppendResult(interp, "incompatible stub library: have ", + TCL_VERSION ", need 9"); + return NULL; + } + tclStubsPtr = (TclStubs *)pkgData; if (tclStubsPtr->hooks) { diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c index 71bd846..5a3ccd4 100644 --- a/unix/tclUnixCompat.c +++ b/unix/tclUnixCompat.c @@ -693,12 +693,11 @@ TclWinCPUID( /* See: <http://en.wikipedia.org/wiki/CPUID> */ #if defined(HAVE_CPUID) - __asm__ __volatile__("mov %%ebx, %%edi \n\t" /* save %ebx */ + __asm__ __volatile__("mov %%ebx, %%esi \n\t" /* save %ebx */ "cpuid \n\t" - "mov %%ebx, %%esi \n\t" /* save what cpuid just put in %ebx */ - "mov %%edi, %%ebx \n\t" /* restore the old %ebx */ + "xchg %%esi, %%ebx \n\t" /* restore the old %ebx */ : "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3]) - : "a"(index) : "edi"); + : "a"(index)); status = TCL_OK; #endif return status; diff --git a/win/configure b/win/configure index 062e8a4..db5b56b 100755 --- a/win/configure +++ b/win/configure @@ -1907,6 +1907,7 @@ else #include "confdefs.h" #define WIN32_LEAN_AND_MEAN +#define INCL_WINSOCK_API_TYPEDEFS 1 #include <windows.h> #undef WIN32_LEAN_AND_MEAN #include <winsock2.h> @@ -1917,7 +1918,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1921: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1922: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_lpfn_decls=yes else @@ -1949,12 +1950,12 @@ fi # call it from inline asm code. echo $ac_n "checking for alloca declaration in malloc.h""... $ac_c" 1>&6 -echo "configure:1953: checking for alloca declaration in malloc.h" >&5 +echo "configure:1954: checking for alloca declaration in malloc.h" >&5 if eval "test \"`echo '$''{'tcl_cv_malloc_decl_alloca'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1958 "configure" +#line 1959 "configure" #include "confdefs.h" #include <malloc.h> @@ -1968,7 +1969,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1973: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_malloc_decl_alloca=yes else @@ -1999,7 +2000,7 @@ fi echo $ac_n "checking for build with symbols""... $ac_c" 1>&6 -echo "configure:2003: checking for build with symbols" >&5 +echo "configure:2004: 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" @@ -2063,7 +2064,7 @@ TCL_DBGX=${DBGX} #-------------------------------------------------------------------- echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2067: checking how to run the C preprocessor" >&5 +echo "configure:2068: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2078,13 +2079,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 2082 "configure" +#line 2083 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2088: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2089: \"$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 : @@ -2095,13 +2096,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 2099 "configure" +#line 2100 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2105: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2106: \"$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 : @@ -2112,13 +2113,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext <<EOF -#line 2116 "configure" +#line 2117 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2122: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2123: \"$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 : @@ -2144,17 +2145,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:2148: checking for errno.h" >&5 +echo "configure:2149: 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 -#line 2153 "configure" +#line 2154 "configure" #include "confdefs.h" #include <errno.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2158: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2159: \"$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* @@ -2408,15 +2409,34 @@ trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. -cat > conftest.defs <<\EOF -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g -s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g -s%\[%\\&%g -s%\]%\\&%g -s%\$%$$%g -EOF -DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` -rm -f conftest.defs +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then we branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +cat >confdef2opt.sed <<\_ACEOF +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +t quote +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +t quote +d +: quote +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,\[,\\&,g +s,\],\\&,g +s,\$,$$,g +p +_ACEOF +# We use echo to avoid assuming a particular line-breaking character. +# The extra dot is to prevent the shell from consuming trailing +# line-breaks from the sub-command output. A line-break within +# single-quotes doesn't work because, if this script is created in a +# platform that uses two characters for line-breaks (e.g., DOS), tr +# would break. +ac_LF_and_DOT=`echo; echo .` +DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` +rm -f confdef2opt.sed # Without the "./", some shells look in PATH for config.status. |