summaryrefslogtreecommitdiffstats
path: root/generic/tclStubLib.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-11-26 21:25:26 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-11-26 21:25:26 (GMT)
commitd0aa8bd6eb7c9ef510cf66beb42922019e05180d (patch)
treea471d2cd7c3ce6d494abef9585803dfd67e393b4 /generic/tclStubLib.c
parent35a4980629e819d1f5a36c04c4f994fccbb19124 (diff)
downloadtcl-d0aa8bd6eb7c9ef510cf66beb42922019e05180d.zip
tcl-d0aa8bd6eb7c9ef510cf66beb42922019e05180d.tar.gz
tcl-d0aa8bd6eb7c9ef510cf66beb42922019e05180d.tar.bz2
Comments and renamings around the legacy fields for string results.
Diffstat (limited to 'generic/tclStubLib.c')
-rw-r--r--generic/tclStubLib.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/generic/tclStubLib.c b/generic/tclStubLib.c
index 9e9208d..35c7f09 100644
--- a/generic/tclStubLib.c
+++ b/generic/tclStubLib.c
@@ -41,9 +41,32 @@ HasStubSupport(
if (iPtr->stubTable && (iPtr->stubTable->magic == TCL_STUB_MAGIC)) {
return iPtr->stubTable;
}
- iPtr->unused3
+
+ /*
+ * Either interp has no stubTable field, or its magic number has been
+ * changed, indicating a release of Tcl that no longer supports the
+ * stubs mechanism with which the extension has been prepared. This
+ * either means interp comes from Tcl releases 7.5 - 8.0, when [load]
+ * of extensions was possible, but stubs were not yet in use, or it means
+ * interp come from some future release of Tcl where it has been necessary
+ * to stop supporting this particular stubs mechanism. In either case,
+ * we can count on the fields legacyResult and legacyFreeProc existing
+ * (since they persist to maintain the struct offset fo stubTable; see
+ * tclInt.h comments.), and we can hope that [load] or any sensible
+ * successor will be able to reach into them to report the mismatch error
+ * message sensibly.
+ *
+ * For maximum compat support, even if only for the sake of reporting
+ * clean errors, rather than crashing, we assume the TCL_STUB_MAGIC
+ * value is changed only when absolutely necessary. So long as the first
+ * slot in the stub table holds (some function compatible with) the routine
+ * Tcl_PkgRequireEx(), that routine can take care of verifying the version
+ * compatibility testing with all deployed
+ */
+
+ iPtr->legacyResult
= "This interpreter does not support stubs-enabled extensions.";
- iPtr->unused4 = TCL_STATIC;
+ iPtr->legacyFreeProc = TCL_STATIC;
return NULL;
}