Skip to content

Commit

Permalink
Merge 8.6
Browse files Browse the repository at this point in the history
  • Loading branch information
jan.nijtmans committed Jan 6, 2025
2 parents 467e8e5 + 571b1d5 commit 551a519
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/InitStubs.3
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
16 changes: 14 additions & 2 deletions generic/tclStubLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 551a519

Please sign in to comment.