diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2025-01-06 22:58:48 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2025-01-06 22:58:48 (GMT) |
| commit | 551a51944b7f5c76ae485090bb126593229ec288 (patch) | |
| tree | 507199e9832d0d78687bd0e4789517cc841d8d6b | |
| parent | 467e8e53bea0d76438a4ceb1a4c6b77bd9c40d56 (diff) | |
| parent | 571b1d50131cc7acf4874616a5ee3169553fe23b (diff) | |
| download | tcl-551a51944b7f5c76ae485090bb126593229ec288.zip tcl-551a51944b7f5c76ae485090bb126593229ec288.tar.gz tcl-551a51944b7f5c76ae485090bb126593229ec288.tar.bz2 | |
Merge 8.6
| -rw-r--r-- | doc/InitStubs.3 | 2 | ||||
| -rw-r--r-- | generic/tclStubLib.c | 16 |
2 files changed, 15 insertions, 3 deletions
diff --git a/doc/InitStubs.3 b/doc/InitStubs.3 index ae77baa..731170d 100644 --- a/doc/InitStubs.3 +++ b/doc/InitStubs.3 @@ -80,7 +80,7 @@ and a Boolean flag indicating whether the extension requires an exact version match or not. If \fIexact\fR is 0, then the extension is indicating that newer versions of Tcl are acceptable as long as they have the same major version number as \fIversion\fR; -non-zero means that only the specified \fIversion\fR is acceptable. +1 means that only the specified \fIversion\fR is acceptable. \fBTcl_InitStubs\fR returns a string containing the actual version of Tcl satisfying the request, or NULL if the Tcl version is not acceptable, does not support stubs, or any other error condition occurred. diff --git a/generic/tclStubLib.c b/generic/tclStubLib.c index f06b2d1..9a0ce9a 100644 --- a/generic/tclStubLib.c +++ b/generic/tclStubLib.c @@ -71,8 +71,20 @@ Tcl_InitStubs( */ if (!stubsPtr || (stubsPtr->magic != (((exact&0xFF00) >= 0x900) ? magic : TCL_STUB_MAGIC))) { - iPtr->result = (char *)"interpreter uses an incompatible stubs mechanism"; - iPtr->freeProc = 0; /* TCL_STATIC */ + exact &= 0xFFFF00; /* Filter out minor/major Tcl version */ + if (!exact) { + exact = 0x060800; + } + if (stubsPtr && (stubsPtr->magic == ((int)0xFCA3BACB + (int)sizeof(void *))) + && ((exact|0x010000) == 0x070800)) { + /* We are running in Tcl 9.x, but extension is compiled with 8.6 or 8.7 */ + stubsPtr->tcl_SetObjResult(interp, stubsPtr->tcl_ObjPrintf( + "this extension is compiled for Tcl %d.%d", + (exact & 0x0FF00)>>8, (exact & 0x0FF0000)>>16)); + } else { + iPtr->result = (char *)"interpreter uses an incompatible stubs mechanism"; + iPtr->freeProc = 0; /* TCL_STATIC */ + } return NULL; } |
