summaryrefslogtreecommitdiffstats
path: root/unix/dltest/pkgooa.c
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)
commit2dc26cc732ba64065c0bf64d8c63a2c82c539999 (patch)
treefc5516bea85f79e7637f009b635da5d311a914eb /unix/dltest/pkgooa.c
parent1fa1578500c58be8eed071fcbdce604c32b418cd (diff)
downloadtcl-2dc26cc732ba64065c0bf64d8c63a2c82c539999.zip
tcl-2dc26cc732ba64065c0bf64d8c63a2c82c539999.tar.gz
tcl-2dc26cc732ba64065c0bf64d8c63a2c82c539999.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/dltest/pkgooa.c')
-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].
*