diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-10-13 10:45:08 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-10-13 10:45:08 (GMT) |
commit | 2dc26cc732ba64065c0bf64d8c63a2c82c539999 (patch) | |
tree | fc5516bea85f79e7637f009b635da5d311a914eb /unix/dltest | |
parent | 1fa1578500c58be8eed071fcbdce604c32b418cd (diff) | |
download | tcl-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')
-rw-r--r-- | unix/dltest/pkgooa.c | 19 |
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]. * |