diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-06-15 12:24:51 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-06-15 12:24:51 (GMT) |
commit | d7db2aab5a6da13afecf5ce138aef6057ac9a4ba (patch) | |
tree | 86a3d2bc26001cbdcef2959bf48e5a70434b0941 /generic | |
parent | 998ceebf5082ac78852a39d0039075be2cbc8f53 (diff) | |
parent | c23518984f1b61e136d4e57f9554c5f8d3c1d26a (diff) | |
download | tcl-d7db2aab5a6da13afecf5ce138aef6057ac9a4ba.zip tcl-d7db2aab5a6da13afecf5ce138aef6057ac9a4ba.tar.gz tcl-d7db2aab5a6da13afecf5ce138aef6057ac9a4ba.tar.bz2 |
Merge 8.7
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tcl.decls | 3 | ||||
-rw-r--r-- | generic/tclStubLib.c | 9 |
2 files changed, 11 insertions, 1 deletions
diff --git a/generic/tcl.decls b/generic/tcl.decls index 41c3fb9..e2b1db0 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -142,6 +142,7 @@ declare 32 { int Tcl_GetBooleanFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int *intPtr) } +# Only available in Tcl 8.x, NULL in Tcl 9.0 declare 33 { unsigned char *Tcl_GetByteArrayFromObj(Tcl_Obj *objPtr, int *numBytesPtr) } @@ -299,6 +300,7 @@ declare 79 { declare 80 { void Tcl_CancelIdleCall(Tcl_IdleProc *idleProc, ClientData clientData) } +# Only available in Tcl 8.x, NULL in Tcl 9.0 declare 81 { int Tcl_Close(Tcl_Interp *interp, Tcl_Channel chan) } @@ -2421,6 +2423,7 @@ declare 651 { declare 652 { unsigned short *TclGetUnicodeFromObj(Tcl_Obj *objPtr, size_t *lengthPtr) } +# Only available in Tcl 8.x, NULL in Tcl 9.0 declare 653 { unsigned char *TclGetByteArrayFromObj(Tcl_Obj *objPtr, size_t *numBytesPtr) } diff --git a/generic/tclStubLib.c b/generic/tclStubLib.c index 46d2f90..f06b2d1 100644 --- a/generic/tclStubLib.c +++ b/generic/tclStubLib.c @@ -17,11 +17,13 @@ MODULE_SCOPE const TclStubs *tclStubsPtr; MODULE_SCOPE const TclPlatStubs *tclPlatStubsPtr; MODULE_SCOPE const TclIntStubs *tclIntStubsPtr; MODULE_SCOPE const TclIntPlatStubs *tclIntPlatStubsPtr; +MODULE_SCOPE void *tclStubsHandle; const TclStubs *tclStubsPtr = NULL; const TclPlatStubs *tclPlatStubsPtr = NULL; const TclIntStubs *tclIntStubsPtr = NULL; const TclIntPlatStubs *tclIntPlatStubsPtr = NULL; +void *tclStubsHandle = NULL; /* * Use our own ISDIGIT to avoid linking to libc on windows @@ -56,10 +58,12 @@ Tcl_InitStubs( { Interp *iPtr = (Interp *)interp; const char *actualVersion = NULL; - ClientData pkgData = NULL; + void *pkgData = NULL; const TclStubs *stubsPtr = iPtr->stubTable; const char *tclName = (((exact&0xFF00) >= 0x900) ? "tcl" : "Tcl"); +#undef TCL_STUB_MAGIC /* We need the TCL_STUB_MAGIC from Tcl 8.x here */ +#define TCL_STUB_MAGIC ((int) 0xFCA3BACF) /* * We can't optimize this check by caching tclStubsPtr because that * prevents apps from being able to load/unload Tcl dynamically multiple @@ -106,6 +110,9 @@ Tcl_InitStubs( /* We are running Tcl 8.x */ stubsPtr = (TclStubs *)pkgData; } + if (tclStubsHandle == NULL) { + tclStubsHandle = INT2PTR(-1); + } tclStubsPtr = stubsPtr; if (stubsPtr->hooks) { |