Fossil SCM

Fix FOSSIL_ENABLE_TCL so that the build works with both Tcl8.6 and Tcl9.0.

drh 2025-04-26 14:40 trunk
Commit 4f55b393f0fa168b79bfb4c923c47fd5984281536a021cf2928abec11b73eec8
1 file changed +8
--- src/th_tcl.c
+++ src/th_tcl.c
@@ -24,10 +24,14 @@
2424
2525
#include "sqlite3.h"
2626
#include "th.h"
2727
#include "tcl.h"
2828
29
+#if TCL_MAJOR_VERSION<9 && !defined(Tcl_Size)
30
+# define Tcl_Size int
31
+#endif
32
+
2933
/*
3034
** This macro is used to verify that the header version of Tcl meets some
3135
** minimum requirement.
3236
*/
3337
#define MINIMUM_TCL_VERSION(major, minor) \
@@ -183,11 +187,15 @@
183187
** the only Tcl API functions that MUST be called prior to being able to call
184188
** Tcl_InitStubs (i.e. because it requires a Tcl interpreter). For complete
185189
** cleanup if the Tcl stubs initialization fails somehow, the Tcl_DeleteInterp
186190
** and Tcl_Finalize function types are also required.
187191
*/
192
+#if TCL_MAJOR_VERSION>=9
188193
typedef const char *(tcl_FindExecutableProc) (const char *);
194
+#else
195
+typedef void (tcl_FindExecutableProc) (const char *);
196
+#endif
189197
typedef Tcl_Interp *(tcl_CreateInterpProc) (void);
190198
typedef void (tcl_DeleteInterpProc) (Tcl_Interp *);
191199
typedef void (tcl_FinalizeProc) (void);
192200
193201
/*
194202
--- src/th_tcl.c
+++ src/th_tcl.c
@@ -24,10 +24,14 @@
24
25 #include "sqlite3.h"
26 #include "th.h"
27 #include "tcl.h"
28
 
 
 
 
29 /*
30 ** This macro is used to verify that the header version of Tcl meets some
31 ** minimum requirement.
32 */
33 #define MINIMUM_TCL_VERSION(major, minor) \
@@ -183,11 +187,15 @@
183 ** the only Tcl API functions that MUST be called prior to being able to call
184 ** Tcl_InitStubs (i.e. because it requires a Tcl interpreter). For complete
185 ** cleanup if the Tcl stubs initialization fails somehow, the Tcl_DeleteInterp
186 ** and Tcl_Finalize function types are also required.
187 */
 
188 typedef const char *(tcl_FindExecutableProc) (const char *);
 
 
 
189 typedef Tcl_Interp *(tcl_CreateInterpProc) (void);
190 typedef void (tcl_DeleteInterpProc) (Tcl_Interp *);
191 typedef void (tcl_FinalizeProc) (void);
192
193 /*
194
--- src/th_tcl.c
+++ src/th_tcl.c
@@ -24,10 +24,14 @@
24
25 #include "sqlite3.h"
26 #include "th.h"
27 #include "tcl.h"
28
29 #if TCL_MAJOR_VERSION<9 && !defined(Tcl_Size)
30 # define Tcl_Size int
31 #endif
32
33 /*
34 ** This macro is used to verify that the header version of Tcl meets some
35 ** minimum requirement.
36 */
37 #define MINIMUM_TCL_VERSION(major, minor) \
@@ -183,11 +187,15 @@
187 ** the only Tcl API functions that MUST be called prior to being able to call
188 ** Tcl_InitStubs (i.e. because it requires a Tcl interpreter). For complete
189 ** cleanup if the Tcl stubs initialization fails somehow, the Tcl_DeleteInterp
190 ** and Tcl_Finalize function types are also required.
191 */
192 #if TCL_MAJOR_VERSION>=9
193 typedef const char *(tcl_FindExecutableProc) (const char *);
194 #else
195 typedef void (tcl_FindExecutableProc) (const char *);
196 #endif
197 typedef Tcl_Interp *(tcl_CreateInterpProc) (void);
198 typedef void (tcl_DeleteInterpProc) (Tcl_Interp *);
199 typedef void (tcl_FinalizeProc) (void);
200
201 /*
202

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button