summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-06-27 10:25:52 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-06-27 10:25:52 (GMT)
commit3615ba88e11da3d68f04aa1260cfc80f36f5aae1 (patch)
tree639ea45682f39e14be4f84c4b8bab702158303aa
parent2812be6504d5b4a193aa58671284f9172e97751a (diff)
parent6c2f2fec8a334d5889d73e78888036a842496b16 (diff)
downloadtcl-3615ba88e11da3d68f04aa1260cfc80f36f5aae1.zip
tcl-3615ba88e11da3d68f04aa1260cfc80f36f5aae1.tar.gz
tcl-3615ba88e11da3d68f04aa1260cfc80f36f5aae1.tar.bz2
Merge trunk. Make magic stub value different for 64-bit builds, as this can never be stub-compatible with 32-bit builds.
-rw-r--r--generic/tcl.h17
-rw-r--r--generic/tclPkg.c2
-rw-r--r--generic/tclStubLib.c3
3 files changed, 12 insertions, 10 deletions
diff --git a/generic/tcl.h b/generic/tcl.h
index 20ccdb2..03fe564 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -2158,7 +2158,7 @@ typedef int (Tcl_NRPostProc) (ClientData data[], Tcl_Interp *interp,
* stubs tables.
*/
-#define TCL_STUB_MAGIC ((int) 0xFCA3BACF)
+#define TCL_STUB_MAGIC ((int) 0xFCA3BACB + (int) sizeof(void *))
/*
* The following function is required to be defined in all stubs aware
@@ -2168,23 +2168,26 @@ typedef int (Tcl_NRPostProc) (ClientData data[], Tcl_Interp *interp,
*/
const char * Tcl_InitStubs(Tcl_Interp *interp, const char *version,
- int exact, const char *tclversion, int magic);
+ int exact, int magic);
const char * TclTomMathInitializeStubs(Tcl_Interp *interp,
const char *version, int epoch, int revision);
#ifdef USE_TCL_STUBS
#if TCL_RELEASE_LEVEL == TCL_FINAL_RELEASE
# define Tcl_InitStubs(interp, version, exact) \
- (Tcl_InitStubs)((interp), (version), (exact)|(int)sizeof(size_t), \
- TCL_VERSION, TCL_STUB_MAGIC)
+ (Tcl_InitStubs)(interp, version, \
+ (exact)|(TCL_MAJOR_VERSION<<8)|(TCL_MINOR_VERSION<<16), \
+ TCL_STUB_MAGIC)
#else
# define Tcl_InitStubs(interp, version, exact) \
- (Tcl_InitStubs)(interp, TCL_PATCH_LEVEL, 1|(int)sizeof(size_t), \
- TCL_VERSION, TCL_STUB_MAGIC)
+ (Tcl_InitStubs)(interp, TCL_PATCH_LEVEL, \
+ 1|(TCL_MAJOR_VERSION<<8)|(TCL_MINOR_VERSION<<16), \
+ TCL_STUB_MAGIC)
#endif
#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
/*
diff --git a/generic/tclPkg.c b/generic/tclPkg.c
index b269e9a..188794f 100644
--- a/generic/tclPkg.c
+++ b/generic/tclPkg.c
@@ -1854,7 +1854,7 @@ Tcl_PkgInitStubsCheck(
{
const char *actualVersion = Tcl_PkgPresentEx(interp, "Tcl", version, 0, NULL);
- if (exact && actualVersion) {
+ if ((exact&1) && actualVersion) {
const char *p = version;
int count = 0;
diff --git a/generic/tclStubLib.c b/generic/tclStubLib.c
index a76c7fb..a4460dd 100644
--- a/generic/tclStubLib.c
+++ b/generic/tclStubLib.c
@@ -57,7 +57,6 @@ Tcl_InitStubs(
Tcl_Interp *interp,
const char *version,
int exact,
- const char *tclversion,
int magic)
{
Interp *iPtr = (Interp *) interp;
@@ -71,7 +70,7 @@ Tcl_InitStubs(
* times. [Bug 615304]
*/
- if (!stubsPtr || (stubsPtr->magic != TCL_STUB_MAGIC)) {
+ if (!stubsPtr || (stubsPtr->magic != magic)) {
iPtr->legacyResult = "interpreter uses an incompatible stubs mechanism";
iPtr->legacyFreeProc = 0; /* TCL_STATIC */
return NULL;