OpenSTA/tcl
Henner Zeller e8218f2db1
Tcl 9 compatibility changes (#414)
* Provide close2proc function to prevent tcl9 from crashing.

Tcl 9 does not test if the close2Proc function pointer is non-null,
but calls it unconditionally:
https://github.com/tcltk/tcl/blob/core-9-0-3/generic/tclIO.c#L384

So we need to provide a non-null function pointer for our code
to not crash with Tcl9.

Use the same implementation as the previous close channel
had.

Signed-off-by: Henner Zeller <h.zeller@acm.org>

* Use non-deprecated trace add variable syntax.

In modern tcl, `trace variable` is now i`trace add variable`,
and `"rw"` should be spelled out as `{read write}`
There were backwards compatible forms in Tcl 8.x but now loudly
complains in Tcl 9

Signed-off-by: Henner Zeller <h.zeller@acm.org>

* Use `Tcl_Size` for all tcl functions returning sizes.

This is the type the Tcl-API provides in its prototypes and
starting from Tcl9 this typedef actually changes from `int` to `long`,
so will no longer compile when passing an `int*`.

So whenever we get a return value of this type, use the
correct typedef to declare the variable. This makes it forward and
backward compatible.

Signed-off-by: Henner Zeller <h.zeller@acm.org>

* Address review comments: compare with `read`/`write` not `r`, `w`

Signed-off-by: Henner Zeller <h.zeller@acm.org>

---------

Signed-off-by: Henner Zeller <h.zeller@acm.org>
2026-04-03 11:02:25 -07:00
..
CmdArgs.tcl update copyright 2026-03-10 14:57:45 -07:00
CmdUtil.tcl update copyright 2026-03-10 14:57:45 -07:00
Exception.i update copyright 2026-03-10 14:57:45 -07:00
Init.tcl update copyright 2026-03-10 14:57:45 -07:00
Property.tcl update copyright 2026-03-10 14:57:45 -07:00
Splash.tcl update copyright 2026-03-10 14:57:45 -07:00
Sta.tcl filter_objects via Akash Levy resolves #399 2026-03-30 09:36:21 -07:00
StaTclTypes.i Tcl 9 compatibility changes (#414) 2026-04-03 11:02:25 -07:00
TclTypeHelpers.cc Tcl 9 compatibility changes (#414) 2026-04-03 11:02:25 -07:00
Util.tcl string squash 2026-03-28 19:13:35 -07:00
Variables.tcl Tcl 9 compatibility changes (#414) 2026-04-03 11:02:25 -07:00