summaryrefslogtreecommitdiffstats
path: root/generic/tclStubLib.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2017-06-05 23:20:36 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2017-06-05 23:20:36 (GMT)
commitf8223fa81718da26562fff851b4a56d18b58a62a (patch)
tree2c47bdd025eab065e5f559ade49795a3acaf938e /generic/tclStubLib.c
parente9d31a334b4cbd18716b3c1eacf7f516cbc7286d (diff)
parent0b178367ba3b9a10d44f89025c89292a4ea49b20 (diff)
downloadtcl-dkf_expose_ptrgetvar.zip
tcl-dkf_expose_ptrgetvar.tar.gz
tcl-dkf_expose_ptrgetvar.tar.bz2
Diffstat (limited to 'generic/tclStubLib.c')
-rw-r--r--generic/tclStubLib.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/generic/tclStubLib.c b/generic/tclStubLib.c
index afabdca..5261591 100644
--- a/generic/tclStubLib.c
+++ b/generic/tclStubLib.c
@@ -67,7 +67,7 @@ Tcl_InitStubs(
if (!stubsPtr || (stubsPtr->magic != (((exact&0xff00) >= 0x900) ? magic : TCL_STUB_MAGIC))) {
iPtr->result = (char *)"interpreter uses an incompatible stubs mechanism";
- iPtr->freeProc = TCL_STATIC;
+ iPtr->freeProc = 0;
return NULL;
}
@@ -101,12 +101,16 @@ Tcl_InitStubs(
}
}
}
- tclStubsPtr = (TclStubs *)pkgData;
+ if (((exact&0xff00) < 0x900)) {
+ /* We are running Tcl 8.x */
+ stubsPtr = (TclStubs *)pkgData;
+ }
+ tclStubsPtr = stubsPtr;
- if (tclStubsPtr->hooks) {
- tclPlatStubsPtr = tclStubsPtr->hooks->tclPlatStubs;
- tclIntStubsPtr = tclStubsPtr->hooks->tclIntStubs;
- tclIntPlatStubsPtr = tclStubsPtr->hooks->tclIntPlatStubs;
+ if (stubsPtr->hooks) {
+ tclPlatStubsPtr = stubsPtr->hooks->tclPlatStubs;
+ tclIntStubsPtr = stubsPtr->hooks->tclIntStubs;
+ tclIntPlatStubsPtr = stubsPtr->hooks->tclIntPlatStubs;
} else {
tclPlatStubsPtr = NULL;
tclIntStubsPtr = NULL;