Skip to content

Commit

Permalink
lib: adapt Tcl_InitStubs for Tcl 9
Browse files Browse the repository at this point in the history
Version requirement of Tcl_InitStubs function should be of same major
version number unless version argument finishes with "-" character.
  • Loading branch information
xdelaruelle committed Sep 16, 2024
1 parent 4a9012f commit 9a7aeb0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ Modules 5.5.0 (not yet released)
Ruby script. (fix issue #535)
* Add PowerShell Core (``pwsh``) shell support. (fix issue #326 with
contribution from Simon Lukas Märtens)
* Lib: adapt Modules Tcl extension library to properly load on Tcl 9.

.. warning:: Variant names are now fully checked instead of just verifying
their first character. Only characters within the ``A-Za-z0-9_-`` range are
Expand Down
4 changes: 2 additions & 2 deletions lib/envmodules.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,8 +591,8 @@ DLLEXPORT int
Envmodules_Init(
Tcl_Interp* interp /* Tcl interpreter */
) {
/* Require Tcl */
if (Tcl_InitStubs(interp, "8.5", 0) == NULL) {
/* Require at least Tcl 8.5 */
if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
return TCL_ERROR;
}

Expand Down
2 changes: 1 addition & 1 deletion testsuite/modules.00-init/120-siteconfig.exp
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ if {[info exists tclextlib_file] && [file executable ./tclsh83]} {
setenv_var TESTSUITE_ENABLE_SITECONFIG_TCLEXTLIBLOAD83 1

set tserr [escre "$error_msgs: Site configuration source failed
version conflict for package \"Tcl\": have 8.3, need 8.5
version conflict for package \"Tcl\": have 8.3, need 8.5-
while executing
\"exec ./tclsh83 << \"load \[getConf tcl_ext_lib\] Envmodules\"<EXM>\"
(file \"$siteconfig_file\" line 2)<EXM>"]
Expand Down

0 comments on commit 9a7aeb0

Please sign in to comment.