diff options
author | seandeelywoods <seandeelywoods> | 2013-03-18 12:41:14 (GMT) |
---|---|---|
committer | seandeelywoods <seandeelywoods> | 2013-03-18 12:41:14 (GMT) |
commit | 87d0bd2b565cc904bdd135291c1baa5ff5cea4d5 (patch) | |
tree | 63b370c68febf9ed24fc630644117cf735313b40 /generic/tclTomMathStubLib.c | |
parent | 3faa92fe264c5671bd8dad903cb13ca5ce302781 (diff) | |
parent | 3fda4f0df6f0fdabe84372aee281ffb4ca7108e1 (diff) | |
download | tcl-hypnotoad_bug_3598385.zip tcl-hypnotoad_bug_3598385.tar.gz tcl-hypnotoad_bug_3598385.tar.bz2 |
Merging in changes from trunkhypnotoad_bug_3598385
Diffstat (limited to 'generic/tclTomMathStubLib.c')
-rw-r--r-- | generic/tclTomMathStubLib.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/generic/tclTomMathStubLib.c b/generic/tclTomMathStubLib.c index a3bc4b3..324f2a3 100644 --- a/generic/tclTomMathStubLib.c +++ b/generic/tclTomMathStubLib.c @@ -11,15 +11,6 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ -/* - * We need to ensure that we use the stub macros so that this file contains no - * references to any of the stub functions. This will make it possible to - * build an extension that references Tcl_InitStubs but doesn't end up - * including the rest of the stub functions. - */ - -#define USE_TCL_STUBS - #include "tclInt.h" MODULE_SCOPE const TclTomMathStubs *tclTomMathStubsPtr; @@ -55,31 +46,30 @@ TclTomMathInitializeStubs( int exact = 0; const char *packageName = "tcl::tommath"; const char *errMsg = NULL; - ClientData pkgClientData = NULL; - const char *actualVersion = - Tcl_PkgRequireEx(interp, packageName, version, exact, &pkgClientData); - const TclTomMathStubs *stubsPtr = pkgClientData; + TclTomMathStubs *stubsPtr = NULL; + const char *actualVersion = tclStubsPtr->tcl_PkgRequireEx(interp, + packageName, version, exact, &stubsPtr); if (actualVersion == NULL) { return NULL; } - if (pkgClientData == NULL) { + if (stubsPtr == NULL) { errMsg = "missing stub table pointer"; - } else if ((stubsPtr->tclBN_epoch)() != epoch) { + } else if(stubsPtr->tclBN_epoch() != epoch) { errMsg = "epoch number mismatch"; - } else if ((stubsPtr->tclBN_revision)() != revision) { + } else if(stubsPtr->tclBN_revision() != revision) { errMsg = "requires a later revision"; } else { tclTomMathStubsPtr = stubsPtr; return actualVersion; } - - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "error loading %s (requested version %s, actual version %s): %s", - packageName, version, actualVersion, errMsg)); + tclStubsPtr->tcl_ResetResult(interp); + tclStubsPtr->tcl_AppendResult(interp, "Error loading ", packageName, + " (requested version ", version, ", actual version ", + actualVersion, "): ", errMsg, NULL); return NULL; } - + /* * Local Variables: * mode: c |