diff -urNp openmsx-20.0-orig/build/libraries.py openmsx-20.0/build/libraries.py --- openmsx-20.0-orig/build/libraries.py 2025-04-03 17:53:57.000000000 +0300 +++ openmsx-20.0/build/libraries.py 2025-04-18 01:55:51.081067959 +0300 @@ -372,7 +372,7 @@ class TCL(Library): if isdir(libpath): yield libpath for entry in listdir(libpath): - if entry.startswith('tcl8.'): + if entry.startswith('tcl9.'): tclpath = libpath + '/' + entry if isdir(tclpath): yield tclpath diff -urNp openmsx-20.0-orig/src/commands/Interpreter.cc openmsx-20.0/src/commands/Interpreter.cc --- openmsx-20.0-orig/src/commands/Interpreter.cc 2025-04-03 17:53:57.000000000 +0300 +++ openmsx-20.0/src/commands/Interpreter.cc 2025-04-18 21:24:19.416413810 +0300 @@ -35,8 +35,7 @@ namespace { static std::vector traces; // sorted on id static uintptr_t traceCount = 0; - -static int dummyClose(ClientData /*instanceData*/, Tcl_Interp* /*interp*/) +static int dummyClose(void *foo, Tcl_Interp *bar, int baz) { return 0; } @@ -55,8 +54,8 @@ static int dummyGetHandle(ClientData /*i } Tcl_ChannelType Interpreter::channelType = { "openMSX console", // Type name - nullptr, // Always non-blocking - dummyClose, // Close proc + TCL_CHANNEL_VERSION_5, + nullptr, // Close proc dummyInput, // Input proc Interpreter::outputProc, // Output proc nullptr, // Seek proc @@ -64,7 +63,7 @@ Tcl_ChannelType Interpreter::channelType nullptr, // Get option proc dummyWatch, // Watch for events on console dummyGetHandle, // Get a handle from the device - nullptr, // Tcl_DriverClose2Proc + dummyClose, // Tcl_DriverClose2Proc nullptr, // Tcl_DriverBlockModeProc nullptr, // Tcl_DriverFlushProc nullptr, // Tcl_DriverHandlerProc diff -urNp openmsx-20.0-orig/src/commands/TclObject.cc openmsx-20.0/src/commands/TclObject.cc --- openmsx-20.0-orig/src/commands/TclObject.cc 2025-04-03 17:53:57.000000000 +0300 +++ openmsx-20.0/src/commands/TclObject.cc 2025-04-18 00:43:30.929232289 +0300 @@ -140,14 +140,14 @@ std::optional TclObject::getOpti zstring_view TclObject::getString() const { - int length; + long int length; const char* buf = Tcl_GetStringFromObj(obj, &length); return {buf, size_t(length)}; } std::span TclObject::getBinary() const { - int length; + long int length; const auto* buf = Tcl_GetByteArrayFromObj(obj, &length); return {buf, size_t(length)}; } @@ -155,7 +155,7 @@ std::span TclObject::getB unsigned TclObject::getListLength(Interpreter& interp_) const { auto* interp = interp_.interp; - int result; + long int result; if (Tcl_ListObjLength(interp, obj, &result) != TCL_OK) { throwException(interp); } @@ -163,7 +163,7 @@ unsigned TclObject::getListLength(Interp } unsigned TclObject::getListLengthUnchecked() const { - int result; + long int result; if (Tcl_ListObjLength(nullptr, obj, &result) != TCL_OK) { return 0; // error } diff -urNp openmsx-20.0-orig/src/commands/TclParser.cc openmsx-20.0/src/commands/TclParser.cc --- openmsx-20.0-orig/src/commands/TclParser.cc 2025-04-03 17:53:57.000000000 +0300 +++ openmsx-20.0/src/commands/TclParser.cc 2025-04-18 00:41:55.219070475 +0300 @@ -98,7 +98,7 @@ void TclParser::parse(std::string parseS bool allowComplete = ((offset + parseStr.size()) >= colors.size()) && (retryCount < 10); Tcl_Obj* resObj = Tcl_GetObjResult(interp); - int resLen; + long int resLen; const char* resStr = Tcl_GetStringFromObj(resObj, &resLen); std::string_view error(resStr, resLen);