-
Notifications
You must be signed in to change notification settings - Fork 9
Improve Tcl 8.7/9.0 readiness, const
usage
#42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
In order to test changes in Tcl::pTk for supporting Tk 8.7, I would like get Tcl.pm to build and run with Tcl 8.7/9.0. I am going to repurpose this pull request to include other changes which I believe will be needed:
|
ok, nice. thanks! |
const
usage
ffd83b7
to
8a8b231
Compare
I am trying to figure out how to properly deal with various types ( I am also considering how to deal with Tcl TIP 484 which removes the It sounds like upstream Tcl may be willing to help C API users migrate, as there are not very many which are still actively maintained (edit: see https://core.tcl-lang.org/tcl/info/3bb3bcf2da5b). |
05a9ba9
to
88a0695
Compare
Documentation for Tcl_GetStringFromObj() recommends assigning to `const char *`
Tcl_GetObjType() returns const as of Tcl 8.6, and Tcl.xs never modifies these structs
Constify variables as needed Convert existing `CONST`/`CONST84` usage to `const` (This removes USE_NON_CONST compatibility, which should not be needed since Tcl.pm has required Tcl 8.4 or later since 2004) Needed for building with Tcl 9.0 (and Tcl 8.7 when TCL_NO_DEPRECATED is defined) since tcl.h no longer defines CONST84 or recognizes USE_NON_CONST.
Remove Tcl::INTERP_DESTROYED constant Add method InterpDeleted() Any existing checks relying on Tcl::INTERP_DESTROYED must migrate to checking InterpDeleted() instead.
tcl.h normally does not define these macros in Tcl 9.0 (and Tcl 8.7 when TCL_NO_DEPRECATED is defined), and has allowed these macros to already be defined since Tcl 8.4b2. Perl’s definitions for these macros (for C compilers) are equivalent to those in tcl.h.
…i.e. various types merged or no longer registered in Tcl 8.7/9.0 Convert wideInt to IV/UV when possible Convert string booleans (i.e. "true"/"false"/"yes"/"no"/"on"/"off") to 0 or 1 Closes gisle#47
I am satisfied enough with the work in this pull request for it to be merged. There is at least one remaining issue where Tcl.pm built to use stubs will not load with Tcl 9.0 ( |
Tcl_GetObjType()
returnsconst
as of Tcl 8.6, and Tcl.xs never modifies these structs