Fossil SCM
Fix FOSSIL_ENABLE_TCL so that the build works with both Tcl8.6 and Tcl9.0.
Commit
4f55b393f0fa168b79bfb4c923c47fd5984281536a021cf2928abec11b73eec8
Parent
9164a5d1aab52d5…
1 file changed
+8
+8
| --- src/th_tcl.c | ||
| +++ src/th_tcl.c | ||
| @@ -24,10 +24,14 @@ | ||
| 24 | 24 | |
| 25 | 25 | #include "sqlite3.h" |
| 26 | 26 | #include "th.h" |
| 27 | 27 | #include "tcl.h" |
| 28 | 28 | |
| 29 | +#if TCL_MAJOR_VERSION<9 && !defined(Tcl_Size) | |
| 30 | +# define Tcl_Size int | |
| 31 | +#endif | |
| 32 | + | |
| 29 | 33 | /* |
| 30 | 34 | ** This macro is used to verify that the header version of Tcl meets some |
| 31 | 35 | ** minimum requirement. |
| 32 | 36 | */ |
| 33 | 37 | #define MINIMUM_TCL_VERSION(major, minor) \ |
| @@ -183,11 +187,15 @@ | ||
| 183 | 187 | ** the only Tcl API functions that MUST be called prior to being able to call |
| 184 | 188 | ** Tcl_InitStubs (i.e. because it requires a Tcl interpreter). For complete |
| 185 | 189 | ** cleanup if the Tcl stubs initialization fails somehow, the Tcl_DeleteInterp |
| 186 | 190 | ** and Tcl_Finalize function types are also required. |
| 187 | 191 | */ |
| 192 | +#if TCL_MAJOR_VERSION>=9 | |
| 188 | 193 | typedef const char *(tcl_FindExecutableProc) (const char *); |
| 194 | +#else | |
| 195 | +typedef void (tcl_FindExecutableProc) (const char *); | |
| 196 | +#endif | |
| 189 | 197 | typedef Tcl_Interp *(tcl_CreateInterpProc) (void); |
| 190 | 198 | typedef void (tcl_DeleteInterpProc) (Tcl_Interp *); |
| 191 | 199 | typedef void (tcl_FinalizeProc) (void); |
| 192 | 200 | |
| 193 | 201 | /* |
| 194 | 202 |
| --- 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 |