summaryrefslogtreecommitdiffstats
path: root/generic/tcl.h
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-06-27 10:22:30 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-06-27 10:22:30 (GMT)
commita7534bc7ed966b9b399e86be1c6cc2004baf379c (patch)
treef45973080c93357d9df8c61ea5f4f9ca2b039451 /generic/tcl.h
parent179f28ba4605cb66cd358eb8d6d57b42e7bf5bb9 (diff)
downloadtcl-a7534bc7ed966b9b399e86be1c6cc2004baf379c.zip
tcl-a7534bc7ed966b9b399e86be1c6cc2004baf379c.tar.gz
tcl-a7534bc7ed966b9b399e86be1c6cc2004baf379c.tar.bz2
Make TCL_MAJOR_VERSION/TCL_MINOR_VERSION/TCL_STUB_MAGIC available to Tcl_InitStubs() arguments. Useful for debugging and detection of stub incompatibilities (e.g. for Tcl9)
Diffstat (limited to 'generic/tcl.h')
-rw-r--r--generic/tcl.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/generic/tcl.h b/generic/tcl.h
index be40368..6061ea8 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -2377,9 +2377,6 @@ typedef int (Tcl_NRPostProc) (ClientData data[], Tcl_Interp *interp,
*----------------------------------------------------------------------------
* The following constant is used to test for older versions of Tcl in the
* stubs tables.
- *
- * Jan Nijtman's plus patch uses 0xFCA1BACF, so we need to pick a different
- * value since the stubs tables don't match.
*/
#define TCL_STUB_MAGIC ((int) 0xFCA3BACF)
@@ -2392,17 +2389,19 @@ typedef int (Tcl_NRPostProc) (ClientData data[], Tcl_Interp *interp,
*/
const char * Tcl_InitStubs(Tcl_Interp *interp, const char *version,
- int exact);
+ int exact, int magic);
const char * TclTomMathInitializeStubs(Tcl_Interp *interp,
const char *version, int epoch, int revision);
-/*
- * When not using stubs, make it a macro.
- */
-
-#ifndef USE_TCL_STUBS
+#ifdef USE_TCL_STUBS
+#define Tcl_InitStubs(interp, version, exact) \
+ (Tcl_InitStubs)(interp, version, \
+ (exact)|(TCL_MAJOR_VERSION<<8)|(TCL_MINOR_VERSION<<16), \
+ TCL_STUB_MAGIC)
+#else
#define Tcl_InitStubs(interp, version, exact) \
- Tcl_PkgInitStubsCheck(interp, version, exact)
+ Tcl_PkgInitStubsCheck(interp, version, \
+ (exact)|(TCL_MAJOR_VERSION<<8)|(TCL_MINOR_VERSION<<16))
#endif
/*