summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-06-12 15:13:33 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-06-12 15:13:33 (GMT)
commite396c1dd368d128a020f50ded11b388ad9bd4b4b (patch)
treef2939539f6dc1f88bb1da0d53824a281b726a6a5 /generic
parent82fccbc6dc66b696e8e2c0adfcfe6326bb398eea (diff)
downloadtcl-e396c1dd368d128a020f50ded11b388ad9bd4b4b.zip
tcl-e396c1dd368d128a020f50ded11b388ad9bd4b4b.tar.gz
tcl-e396c1dd368d128a020f50ded11b388ad9bd4b4b.tar.bz2
Make the idea (finally) work
Diffstat (limited to 'generic')
-rw-r--r--generic/tcl.h13
-rw-r--r--generic/tclStubLib.c2
2 files changed, 11 insertions, 4 deletions
diff --git a/generic/tcl.h b/generic/tcl.h
index 429054c..d6a59c6 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -2215,7 +2215,12 @@ void * TclStubCall(void *arg);
#endif
#ifdef USE_TCL_STUBS
-#if TCL_RELEASE_LEVEL == TCL_FINAL_RELEASE
+#if TCL_MAJOR_VERSION < 9
+# define Tcl_InitStubs(interp, version, exact) \
+ (Tcl_InitStubs)(interp, version, \
+ (exact)|(TCL_MAJOR_VERSION<<8)|(0xFF<<16), \
+ TCL_STUB_MAGIC)
+#elif TCL_RELEASE_LEVEL == TCL_FINAL_RELEASE
# define Tcl_InitStubs(interp, version, exact) \
(Tcl_InitStubs)(interp, version, \
(exact)|(TCL_MAJOR_VERSION<<8)|(TCL_MINOR_VERSION<<16), \
@@ -2227,7 +2232,9 @@ void * TclStubCall(void *arg);
TCL_STUB_MAGIC)
#endif
#else
-#if TCL_RELEASE_LEVEL == TCL_FINAL_RELEASE
+#if TCL_MAJOR_VERSION < 9
+# error "Please define -DUSE_TCL_STUBS"
+#elif TCL_RELEASE_LEVEL == TCL_FINAL_RELEASE
# define Tcl_InitStubs(interp, version, exact) \
Tcl_PkgInitStubsCheck(interp, version, \
(exact)|(TCL_MAJOR_VERSION<<8)|(TCL_MINOR_VERSION<<16))
@@ -2276,7 +2283,7 @@ EXTERN const char *TclZipfs_AppHook(int *argc, char ***argv);
EXTERN TCL_NORETURN void Tcl_MainExW(size_t argc, wchar_t **argv,
Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
#endif
-#ifdef USE_TCL_STUBS
+#if defined(USE_TCL_STUBS) && (TCL_MAJOR_VERSION > 8)
#define Tcl_SetPanicProc(panicProc) \
TclInitStubTable(((const char *(*)(Tcl_PanicProc *))TclStubCall((void *)panicProc))(panicProc))
#define Tcl_InitSubsystems() \
diff --git a/generic/tclStubLib.c b/generic/tclStubLib.c
index d09ab2b..74fcedd 100644
--- a/generic/tclStubLib.c
+++ b/generic/tclStubLib.c
@@ -68,7 +68,7 @@ Tcl_InitStubs(
* times. [Bug 615304]
*/
- if (!stubsPtr || (stubsPtr->magic != (((exact&0xFF00) >= 0x900) ? magic : TCL_STUB_MAGIC))) {
+ if (!stubsPtr || (stubsPtr->magic != (((exact&0xFF00) >= 0x900) ? magic : -56378673))) {
iPtr->legacyResult = "interpreter uses an incompatible stubs mechanism";
iPtr->legacyFreeProc = 0; /* TCL_STATIC */
return NULL;