1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
From: Sergei Golovan
Description: Implement loading into either Tcl 8 or Tcl 9
Date: Thu, 20 Mar 2025 14:59:24 +0300
@@ -138,6 +138,13 @@
* udpInit
* ----------------------------------------------------------------------
*/
+
+#if TCL_MAJOR_VERSION > 8
+#define MIN_VERSION "9.0"
+#else
+#define MIN_VERSION "8.5"
+#endif
+
int
Udp_Init(Tcl_Interp *interp)
{
@@ -147,7 +154,9 @@
#endif
#ifdef USE_TCL_STUBS
- Tcl_InitStubs(interp, "8.1", 0);
+ if (Tcl_InitStubs(interp, MIN_VERSION, 0) == NULL) {
+ return TCL_ERROR;
+ }
#endif
#ifdef WIN32
@@ -1,5 +1,10 @@
#
# Tcl package index file
#
-package ifneeded @PACKAGE_NAME@ @PACKAGE_VERSION@ \
- [list load [file join $dir @PKG_LIB_FILE@]]
+if {[package vsatisfies [package provide Tcl] 9.0-]} {
+ package ifneeded @PACKAGE_NAME@ @PACKAGE_VERSION@ \
+ [list load [file join $dir @PKG_LIB_FILE9@]]
+} else {
+ package ifneeded @PACKAGE_NAME@ @PACKAGE_VERSION@ \
+ [list load [file join $dir @PKG_LIB_FILE8@]]
+}
|