diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-11-30 15:42:56 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-11-30 15:42:56 (GMT) |
commit | 64a81406f2649f08e1e61f68a92ef77fc2c31f32 (patch) | |
tree | 4643e6c67f1d1d2d7f0621d3887353e0ea82cf93 /generic/tclStubLib.c | |
parent | 83409874d9644cc0926e20e01bd7213c07412db5 (diff) | |
parent | 02e5732cffb9d23e1ea6612ee37c19a88e4891f2 (diff) | |
download | tcl-64a81406f2649f08e1e61f68a92ef77fc2c31f32.zip tcl-64a81406f2649f08e1e61f68a92ef77fc2c31f32.tar.gz tcl-64a81406f2649f08e1e61f68a92ef77fc2c31f32.tar.bz2 |
merge (modified) novem-review.
unbreak windows build
Diffstat (limited to 'generic/tclStubLib.c')
-rw-r--r-- | generic/tclStubLib.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/generic/tclStubLib.c b/generic/tclStubLib.c index bd80ec1..5914deb 100644 --- a/generic/tclStubLib.c +++ b/generic/tclStubLib.c @@ -35,28 +35,21 @@ const TclIntPlatStubs *tclIntPlatStubsPtr = NULL; static const TclStubs * HasStubSupport( Tcl_Interp *interp, + const char *tclversion, int magic) { + /* TODO: Whatever additional checks using tclversion + * and/or magic should be done here. */ + Interp *iPtr = (Interp *) interp; - if (!iPtr->stubTable) { - /* No stub table at all? Nothing we can do. */ - return NULL; - } - if (iPtr->stubTable->magic != magic) { - /* - * The iPtr->stubTable entry from Tcl_Interp and the - * Tcl_NewStringObj() and Tcl_SetObjResult() entries - * in the stub table cannot change in Tcl 9 compared - * to Tcl 8.x. Otherwise the lines below won't work. - * TODO: add a test case for that. - */ - iPtr->stubTable->tcl_SetObjResult(interp, - iPtr->stubTable->tcl_NewStringObj( - "This extension is compiled for Tcl 9.x", -1)); - return NULL; + if (iPtr->stubTable && iPtr->stubTable->magic == magic) { + return iPtr->stubTable; } - return iPtr->stubTable; + iPtr->result = + (char *) "interpreter uses an incompatible stubs mechanism"; + iPtr->freeProc = TCL_STATIC; + return NULL; } /* @@ -91,6 +84,7 @@ TclInitStubs( Tcl_Interp *interp, const char *version, int exact, + const char *tclversion, int magic) { const char *actualVersion = NULL; @@ -102,7 +96,7 @@ TclInitStubs( * times. [Bug 615304] */ - tclStubsPtr = HasStubSupport(interp, magic); + tclStubsPtr = HasStubSupport(interp, tclversion, magic); if (!tclStubsPtr) { return NULL; } |