summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-10-13 10:45:08 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-10-13 10:45:08 (GMT)
commit9ad995c1bbe6cd3cda29bfdb8e177025ba8f05f7 (patch)
treefc5516bea85f79e7637f009b635da5d311a914eb /unix
parent31d188239f62698436ce4cfe0f4cbb18d0df2bfb (diff)
downloadtcl-9ad995c1bbe6cd3cda29bfdb8e177025ba8f05f7.zip
tcl-9ad995c1bbe6cd3cda29bfdb8e177025ba8f05f7.tar.gz
tcl-9ad995c1bbe6cd3cda29bfdb8e177025ba8f05f7.tar.bz2
Allow loading of pkgooa.so in Tcl 8.5 for (regression) test purposes.
Better error messages in stead of crashes in some (hypothetical) error situations.
Diffstat (limited to 'unix')
-rw-r--r--unix/dltest/pkgooa.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/unix/dltest/pkgooa.c b/unix/dltest/pkgooa.c
index bdac9db..c0c1605 100644
--- a/unix/dltest/pkgooa.c
+++ b/unix/dltest/pkgooa.c
@@ -106,12 +106,29 @@ Pkgooa_Init(
{
int code;
- if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
+ /* Any TclOO extension which uses stubs, calls
+ * both Tcl_InitStubs and Tcl_OOInitStubs() and
+ * does not use any Tcl 8.6 features should be
+ * loadable in Tcl 8.5 as well, provided the
+ * TclOO extension (for Tcl 8.5) is installed.
+ * This worked in Tcl 8.6.0, and is expected
+ * to keep working in all future Tcl 8.x releases.
+ */
+ if (Tcl_InitStubs(interp, "8.5", 0) == NULL) {
+ return TCL_ERROR;
+ }
+ if (tclStubsPtr == NULL) {
+ Tcl_AppendResult(interp, "Tcl stubs are not inialized, "
+ "did you compile using -DUSE_TCL_STUBS? ");
return TCL_ERROR;
}
if (Tcl_OOInitStubs(interp) == NULL) {
return TCL_ERROR;
}
+ if (tclOOStubsPtr == NULL) {
+ Tcl_AppendResult(interp, "TclOO stubs are not inialized");
+ return TCL_ERROR;
+ }
/* Test case for Bug [f51efe99a7].
*