summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tcl.h12
-rw-r--r--generic/tclCkalloc.c4
-rw-r--r--generic/tclExecute.c1
-rw-r--r--generic/tclStubLib.c15
-rw-r--r--unix/tclUnixCompat.c7
5 files changed, 23 insertions, 16 deletions
diff --git a/generic/tcl.h b/generic/tcl.h
index 7bab11b..cf0b2728a 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -2197,22 +2197,20 @@ typedef int (Tcl_NRPostProc) (ClientData data[], Tcl_Interp *interp,
* main library in case an extension is statically linked into an application.
*/
-const char * TclInitStubs(Tcl_Interp *interp, const char *version,
+const char * Tcl_InitStubs(Tcl_Interp *interp, const char *version,
int exact, const char *tclversion, int magic);
const char * TclTomMathInitializeStubs(Tcl_Interp *interp,
const char *version, int epoch, int revision);
-/*
- * When not using stubs, make it a macro.
- */
-
#ifdef USE_TCL_STUBS
#if TCL_RELEASE_LEVEL == TCL_FINAL_RELEASE
# define Tcl_InitStubs(interp, version, exact) \
- TclInitStubs(interp, version, exact, TCL_VERSION, TCL_STUB_MAGIC)
+ (Tcl_InitStubs)((interp), (version), (exact)|(int)sizeof(size_t), \
+ TCL_VERSION, TCL_STUB_MAGIC)
#else
# define Tcl_InitStubs(interp, version, exact) \
- TclInitStubs(interp, TCL_PATCH_LEVEL, 1, TCL_VERSION, TCL_STUB_MAGIC)
+ (Tcl_InitStubs)(interp, TCL_PATCH_LEVEL, 1|(int)sizeof(size_t), \
+ TCL_VERSION, TCL_STUB_MAGIC)
#endif
#else
#define Tcl_InitStubs(interp, version, exact) \
diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c
index 2268e45..ede0d67 100644
--- a/generic/tclCkalloc.c
+++ b/generic/tclCkalloc.c
@@ -156,6 +156,10 @@ TclInitDbCkalloc(void)
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 964f04f..00bd0ab 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -6956,7 +6956,6 @@ TEBCresume(
pc += (opnd-1);
PUSH_OBJECT(Tcl_NewStringObj(bytes, length));
goto instEvalStk;
- NEXT_INST_F(9, 0, 0);
}
}
diff --git a/generic/tclStubLib.c b/generic/tclStubLib.c
index eefa300..cadb7b9 100644
--- a/generic/tclStubLib.c
+++ b/generic/tclStubLib.c
@@ -32,7 +32,7 @@ const TclIntPlatStubs *tclIntPlatStubsPtr = NULL;
/*
*----------------------------------------------------------------------
*
- * TclInitStubs --
+ * Tcl_InitStubs --
*
* Tries to initialise the stub table pointers and ensures that the
* correct version of Tcl is loaded.
@@ -48,7 +48,7 @@ const TclIntPlatStubs *tclIntPlatStubsPtr = NULL;
*/
#undef Tcl_InitStubs
MODULE_SCOPE const char *
-TclInitStubs(
+Tcl_InitStubs(
Tcl_Interp *interp,
const char *version,
int exact,
@@ -76,7 +76,7 @@ TclInitStubs(
if (actualVersion == NULL) {
return NULL;
}
- if (exact) {
+ if (exact&1) {
const char *p = version;
int count = 0;
@@ -102,7 +102,14 @@ TclInitStubs(
}
}
}
- tclStubsPtr = (TclStubs *)pkgData;
+
+ if (stubsPtr->reserved77) {
+ /* We are running Tcl 8. Do some additional checks here. */
+ tclStubsPtr = (TclStubs *)pkgData;
+ } else {
+ /* We are running Tcl 9. Do some additional checks here. */
+ tclStubsPtr = stubsPtr;
+ }
if (tclStubsPtr->hooks) {
tclPlatStubsPtr = tclStubsPtr->hooks->tclPlatStubs;
diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c
index 6de6e75..f8f0080 100644
--- a/unix/tclUnixCompat.c
+++ b/unix/tclUnixCompat.c
@@ -993,12 +993,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","ebx");
+ : "a"(index));
status = TCL_OK;
#endif
return status;