diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-11-30 15:42:56 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-11-30 15:42:56 (GMT) |
commit | 64a81406f2649f08e1e61f68a92ef77fc2c31f32 (patch) | |
tree | 4643e6c67f1d1d2d7f0621d3887353e0ea82cf93 | |
parent | 83409874d9644cc0926e20e01bd7213c07412db5 (diff) | |
parent | 02e5732cffb9d23e1ea6612ee37c19a88e4891f2 (diff) | |
download | tcl-64a81406f2649f08e1e61f68a92ef77fc2c31f32.zip tcl-64a81406f2649f08e1e61f68a92ef77fc2c31f32.tar.gz tcl-64a81406f2649f08e1e61f68a92ef77fc2c31f32.tar.bz2 |
merge (modified) novem-review.
unbreak windows build
-rw-r--r-- | generic/tcl.h | 7 | ||||
-rw-r--r-- | generic/tclBasic.c | 23 | ||||
-rw-r--r-- | generic/tclDecls.h | 2 | ||||
-rw-r--r-- | generic/tclStubLib.c | 30 | ||||
-rw-r--r-- | generic/tclStubLibCompat.c | 2 | ||||
-rw-r--r-- | win/tcl.rc | 2 | ||||
-rw-r--r-- | win/tclWinInt.h | 14 | ||||
-rw-r--r-- | win/tclsh.rc | 2 |
8 files changed, 33 insertions, 49 deletions
diff --git a/generic/tcl.h b/generic/tcl.h index 33bf149..a779947 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -122,7 +122,6 @@ extern "C" { */ #include <stdio.h> -#include <stddef.h> /* *---------------------------------------------------------------------------- @@ -2200,7 +2199,7 @@ typedef int (Tcl_NRPostProc) (ClientData data[], Tcl_Interp *interp, * stubs tables. */ -#define TCL_STUB_MAGIC ((int) (0xFCA3BACB + sizeof(size_t))) +#define TCL_STUB_MAGIC ((int) 0xFCA3BACF) /* * The following function is required to be defined in all stubs aware @@ -2210,7 +2209,7 @@ typedef int (Tcl_NRPostProc) (ClientData data[], Tcl_Interp *interp, */ const char * TclInitStubs(Tcl_Interp *interp, const char *version, - int exact, int magic); + int exact, const char *tclversion, int magic); const char * TclTomMathInitializeStubs(Tcl_Interp *interp, const char *version, int epoch, int revision); @@ -2220,7 +2219,7 @@ const char * TclTomMathInitializeStubs(Tcl_Interp *interp, #ifdef USE_TCL_STUBS #define Tcl_InitStubs(interp, version, exact) \ - TclInitStubs(interp, version, exact, TCL_STUB_MAGIC) + TclInitStubs(interp, version, exact, TCL_VERSION, TCL_STUB_MAGIC) #else #define Tcl_InitStubs(interp, version, exact) \ Tcl_PkgInitStubsCheck(interp, version, exact) diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 146247e..4f3b77e 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -431,14 +431,6 @@ TclFinalizeEvaluation(void) *---------------------------------------------------------------------- */ -/* Template for internal Interp structure: the stubTable entry cannot move! */ -typedef struct { - char *dumm1; - Tcl_FreeProc *dummy2; - int dummy3; - const struct TclStubs *stubTable; -} InterpTemplate; - Tcl_Interp * Tcl_CreateInterp(void) { @@ -474,21 +466,6 @@ Tcl_CreateInterp(void) /*NOTREACHED*/ Tcl_Panic("Tcl_CallFrame must not be smaller than CallFrame"); } - if ((void *) tclStubs.tcl_SetObjResult - != (void *)((&(tclStubs.tcl_PkgProvideEx))[235])) { - /*NOTREACHED*/ - Tcl_Panic("Tcl_SetObjResult entry in the stub table must be kept"); - } - if ((void *) tclStubs.tcl_NewStringObj - != (void *)((&(tclStubs.tcl_PkgProvideEx))[56])) { - /*NOTREACHED*/ - Tcl_Panic("Tcl_NewStringObj entry in the stub table must be kept"); - } - if (TclOffset(InterpTemplate, stubTable) - != TclOffset(Interp, stubTable)) { - /*NOTREACHED*/ - Tcl_Panic("stubsTable entry in the Interp structure must be kept"); - } if (cancelTableInitialized == 0) { Tcl_MutexLock(&cancelLock); diff --git a/generic/tclDecls.h b/generic/tclDecls.h index d152ea8..1b7cf99 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -3744,7 +3744,7 @@ extern const TclStubs *tclStubsPtr; #if defined(_WIN32) && defined(UNICODE) # define Tcl_FindExecutable(arg) ((Tcl_FindExecutable)((const char *)(arg))) # define Tcl_MainEx Tcl_MainExW - EXTERN void Tcl_MainExW(int argc, wchar_t **argv, +TCLAPI void Tcl_MainExW(int argc, wchar_t **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); #endif diff --git a/generic/tclStubLib.c b/generic/tclStubLib.c index bd80ec1..5914deb 100644 --- a/generic/tclStubLib.c +++ b/generic/tclStubLib.c @@ -35,28 +35,21 @@ const TclIntPlatStubs *tclIntPlatStubsPtr = NULL; static const TclStubs * HasStubSupport( Tcl_Interp *interp, + const char *tclversion, int magic) { + /* TODO: Whatever additional checks using tclversion + * and/or magic should be done here. */ + Interp *iPtr = (Interp *) interp; - if (!iPtr->stubTable) { - /* No stub table at all? Nothing we can do. */ - return NULL; - } - if (iPtr->stubTable->magic != magic) { - /* - * The iPtr->stubTable entry from Tcl_Interp and the - * Tcl_NewStringObj() and Tcl_SetObjResult() entries - * in the stub table cannot change in Tcl 9 compared - * to Tcl 8.x. Otherwise the lines below won't work. - * TODO: add a test case for that. - */ - iPtr->stubTable->tcl_SetObjResult(interp, - iPtr->stubTable->tcl_NewStringObj( - "This extension is compiled for Tcl 9.x", -1)); - return NULL; + if (iPtr->stubTable && iPtr->stubTable->magic == magic) { + return iPtr->stubTable; } - return iPtr->stubTable; + iPtr->result = + (char *) "interpreter uses an incompatible stubs mechanism"; + iPtr->freeProc = TCL_STATIC; + return NULL; } /* @@ -91,6 +84,7 @@ TclInitStubs( Tcl_Interp *interp, const char *version, int exact, + const char *tclversion, int magic) { const char *actualVersion = NULL; @@ -102,7 +96,7 @@ TclInitStubs( * times. [Bug 615304] */ - tclStubsPtr = HasStubSupport(interp, magic); + tclStubsPtr = HasStubSupport(interp, tclversion, magic); if (!tclStubsPtr) { return NULL; } diff --git a/generic/tclStubLibCompat.c b/generic/tclStubLibCompat.c index 7d8c5c3..b73c626 100644 --- a/generic/tclStubLibCompat.c +++ b/generic/tclStubLibCompat.c @@ -44,7 +44,7 @@ Tcl_InitStubs( int exact) { /* Use the hardcoded Tcl8 magic value here. */ - return TclInitStubs(interp, version, exact, (int) 0xFCA3BACF); + return TclInitStubs(interp, version, exact, "8.x", (int) 0xFCA3BACF); } /* @@ -2,7 +2,7 @@ // #include <winver.h> -#include <tcl.h> +#include "tclWinInt.h" // // build-up the name suffix that defines the type of build this is. diff --git a/win/tclWinInt.h b/win/tclWinInt.h index 22ad8e9..b3753f4 100644 --- a/win/tclWinInt.h +++ b/win/tclWinInt.h @@ -15,6 +15,20 @@ #include "tclInt.h" /* + * Utility macros: STRINGIFY takes an argument and wraps it in "" (double + * quotation marks), JOIN joins two arguments. + */ + +#ifndef STRINGIFY +# define STRINGIFY(x) STRINGIFY1(x) +# define STRINGIFY1(x) #x +#endif +#ifndef JOIN +# define JOIN(a,b) JOIN1(a,b) +# define JOIN1(a,b) a##b +#endif + +/* * Some versions of Borland C have a define for the OSVERSIONINFO for * Win32s and for NT, but not for Windows 95. * Define VER_PLATFORM_WIN32_CE for those without newer headers. diff --git a/win/tclsh.rc b/win/tclsh.rc index 16eaf83..6e1114d 100644 --- a/win/tclsh.rc +++ b/win/tclsh.rc @@ -2,7 +2,7 @@ // #include <winver.h> -#include <tcl.h> +#include "tclWinInt.h" // // build-up the name suffix that defines the type of build this is. |