Fossil SCM
Skip calling Tcl_InitStubs when not compiled to use the Tcl stubs mechanism.
Commit
1f4cfd5776eb4ad769002030da9eb528e3a8f935
Parent
fbd3c2a5978908e…
1 file changed
+9
-6
+9
-6
| --- src/th_tcl.c | ||
| +++ src/th_tcl.c | ||
| @@ -293,18 +293,18 @@ | ||
| 293 | 293 | int argc, |
| 294 | 294 | const char **argv, |
| 295 | 295 | int *argl |
| 296 | 296 | ){ |
| 297 | 297 | Tcl_Interp *tclInterp; |
| 298 | -#ifndef USE_TCL_EVALOBJV | |
| 298 | +#if !defined(USE_TCL_EVALOBJV) | |
| 299 | 299 | Tcl_Command command; |
| 300 | 300 | Tcl_CmdInfo cmdInfo; |
| 301 | 301 | #endif |
| 302 | 302 | int rc; |
| 303 | 303 | int nResult; |
| 304 | 304 | const char *zResult; |
| 305 | -#ifndef USE_TCL_EVALOBJV | |
| 305 | +#if !defined(USE_TCL_EVALOBJV) | |
| 306 | 306 | Tcl_Obj *objPtr; |
| 307 | 307 | #endif |
| 308 | 308 | USE_ARGV_TO_OBJV(); |
| 309 | 309 | |
| 310 | 310 | if ( createTclInterp(interp, ctx)!=TH_OK ){ |
| @@ -317,11 +317,11 @@ | ||
| 317 | 317 | if( !tclInterp || Tcl_InterpDeleted(tclInterp) ){ |
| 318 | 318 | Th_ErrorMessage(interp, "invalid Tcl interpreter", (const char *)"", 0); |
| 319 | 319 | return TH_ERROR; |
| 320 | 320 | } |
| 321 | 321 | Tcl_Preserve((ClientData)tclInterp); |
| 322 | -#ifndef USE_TCL_EVALOBJV | |
| 322 | +#if !defined(USE_TCL_EVALOBJV) | |
| 323 | 323 | objPtr = Tcl_NewStringObj(argv[1], argl[1]); |
| 324 | 324 | Tcl_IncrRefCount(objPtr); |
| 325 | 325 | command = Tcl_GetCommandFromObj(tclInterp, objPtr); |
| 326 | 326 | if( !command || Tcl_GetCommandInfoFromToken(command,&cmdInfo)==0 ){ |
| 327 | 327 | Th_ErrorMessage(interp, "Tcl command not found:", argv[1], argl[1]); |
| @@ -336,11 +336,11 @@ | ||
| 336 | 336 | return TH_ERROR; |
| 337 | 337 | } |
| 338 | 338 | Tcl_DecrRefCount(objPtr); |
| 339 | 339 | #endif |
| 340 | 340 | COPY_ARGV_TO_OBJV(); |
| 341 | -#ifdef USE_TCL_EVALOBJV | |
| 341 | +#if defined(USE_TCL_EVALOBJV) | |
| 342 | 342 | rc = Tcl_EvalObjv(tclInterp, objc, objv, 0); |
| 343 | 343 | #else |
| 344 | 344 | Tcl_ResetResult(tclInterp); |
| 345 | 345 | rc = cmdInfo.objProc(cmdInfo.objClientData, tclInterp, objc, objv); |
| 346 | 346 | #endif |
| @@ -602,12 +602,15 @@ | ||
| 602 | 602 | if( argc>0 && argv ){ |
| 603 | 603 | argv0 = argv[0]; |
| 604 | 604 | } |
| 605 | 605 | tclContext->xFindExecutable(argv0); |
| 606 | 606 | tclInterp = tclContext->xCreateInterp(); |
| 607 | - if( !tclInterp || !Tcl_InitStubs(tclInterp, "8.4", 0) | |
| 608 | - || Tcl_InterpDeleted(tclInterp) ){ | |
| 607 | + if( !tclInterp || | |
| 608 | +#if defined(USE_TCL_STUBS) | |
| 609 | + !Tcl_InitStubs(tclInterp, "8.4", 0) || | |
| 610 | +#endif | |
| 611 | + Tcl_InterpDeleted(tclInterp) ){ | |
| 609 | 612 | Th_ErrorMessage(interp, |
| 610 | 613 | "Could not create Tcl interpreter", (const char *)"", 0); |
| 611 | 614 | return TH_ERROR; |
| 612 | 615 | } |
| 613 | 616 | tclContext->interp = tclInterp; |
| 614 | 617 |
| --- src/th_tcl.c | |
| +++ src/th_tcl.c | |
| @@ -293,18 +293,18 @@ | |
| 293 | int argc, |
| 294 | const char **argv, |
| 295 | int *argl |
| 296 | ){ |
| 297 | Tcl_Interp *tclInterp; |
| 298 | #ifndef USE_TCL_EVALOBJV |
| 299 | Tcl_Command command; |
| 300 | Tcl_CmdInfo cmdInfo; |
| 301 | #endif |
| 302 | int rc; |
| 303 | int nResult; |
| 304 | const char *zResult; |
| 305 | #ifndef USE_TCL_EVALOBJV |
| 306 | Tcl_Obj *objPtr; |
| 307 | #endif |
| 308 | USE_ARGV_TO_OBJV(); |
| 309 | |
| 310 | if ( createTclInterp(interp, ctx)!=TH_OK ){ |
| @@ -317,11 +317,11 @@ | |
| 317 | if( !tclInterp || Tcl_InterpDeleted(tclInterp) ){ |
| 318 | Th_ErrorMessage(interp, "invalid Tcl interpreter", (const char *)"", 0); |
| 319 | return TH_ERROR; |
| 320 | } |
| 321 | Tcl_Preserve((ClientData)tclInterp); |
| 322 | #ifndef USE_TCL_EVALOBJV |
| 323 | objPtr = Tcl_NewStringObj(argv[1], argl[1]); |
| 324 | Tcl_IncrRefCount(objPtr); |
| 325 | command = Tcl_GetCommandFromObj(tclInterp, objPtr); |
| 326 | if( !command || Tcl_GetCommandInfoFromToken(command,&cmdInfo)==0 ){ |
| 327 | Th_ErrorMessage(interp, "Tcl command not found:", argv[1], argl[1]); |
| @@ -336,11 +336,11 @@ | |
| 336 | return TH_ERROR; |
| 337 | } |
| 338 | Tcl_DecrRefCount(objPtr); |
| 339 | #endif |
| 340 | COPY_ARGV_TO_OBJV(); |
| 341 | #ifdef USE_TCL_EVALOBJV |
| 342 | rc = Tcl_EvalObjv(tclInterp, objc, objv, 0); |
| 343 | #else |
| 344 | Tcl_ResetResult(tclInterp); |
| 345 | rc = cmdInfo.objProc(cmdInfo.objClientData, tclInterp, objc, objv); |
| 346 | #endif |
| @@ -602,12 +602,15 @@ | |
| 602 | if( argc>0 && argv ){ |
| 603 | argv0 = argv[0]; |
| 604 | } |
| 605 | tclContext->xFindExecutable(argv0); |
| 606 | tclInterp = tclContext->xCreateInterp(); |
| 607 | if( !tclInterp || !Tcl_InitStubs(tclInterp, "8.4", 0) |
| 608 | || Tcl_InterpDeleted(tclInterp) ){ |
| 609 | Th_ErrorMessage(interp, |
| 610 | "Could not create Tcl interpreter", (const char *)"", 0); |
| 611 | return TH_ERROR; |
| 612 | } |
| 613 | tclContext->interp = tclInterp; |
| 614 |
| --- src/th_tcl.c | |
| +++ src/th_tcl.c | |
| @@ -293,18 +293,18 @@ | |
| 293 | int argc, |
| 294 | const char **argv, |
| 295 | int *argl |
| 296 | ){ |
| 297 | Tcl_Interp *tclInterp; |
| 298 | #if !defined(USE_TCL_EVALOBJV) |
| 299 | Tcl_Command command; |
| 300 | Tcl_CmdInfo cmdInfo; |
| 301 | #endif |
| 302 | int rc; |
| 303 | int nResult; |
| 304 | const char *zResult; |
| 305 | #if !defined(USE_TCL_EVALOBJV) |
| 306 | Tcl_Obj *objPtr; |
| 307 | #endif |
| 308 | USE_ARGV_TO_OBJV(); |
| 309 | |
| 310 | if ( createTclInterp(interp, ctx)!=TH_OK ){ |
| @@ -317,11 +317,11 @@ | |
| 317 | if( !tclInterp || Tcl_InterpDeleted(tclInterp) ){ |
| 318 | Th_ErrorMessage(interp, "invalid Tcl interpreter", (const char *)"", 0); |
| 319 | return TH_ERROR; |
| 320 | } |
| 321 | Tcl_Preserve((ClientData)tclInterp); |
| 322 | #if !defined(USE_TCL_EVALOBJV) |
| 323 | objPtr = Tcl_NewStringObj(argv[1], argl[1]); |
| 324 | Tcl_IncrRefCount(objPtr); |
| 325 | command = Tcl_GetCommandFromObj(tclInterp, objPtr); |
| 326 | if( !command || Tcl_GetCommandInfoFromToken(command,&cmdInfo)==0 ){ |
| 327 | Th_ErrorMessage(interp, "Tcl command not found:", argv[1], argl[1]); |
| @@ -336,11 +336,11 @@ | |
| 336 | return TH_ERROR; |
| 337 | } |
| 338 | Tcl_DecrRefCount(objPtr); |
| 339 | #endif |
| 340 | COPY_ARGV_TO_OBJV(); |
| 341 | #if defined(USE_TCL_EVALOBJV) |
| 342 | rc = Tcl_EvalObjv(tclInterp, objc, objv, 0); |
| 343 | #else |
| 344 | Tcl_ResetResult(tclInterp); |
| 345 | rc = cmdInfo.objProc(cmdInfo.objClientData, tclInterp, objc, objv); |
| 346 | #endif |
| @@ -602,12 +602,15 @@ | |
| 602 | if( argc>0 && argv ){ |
| 603 | argv0 = argv[0]; |
| 604 | } |
| 605 | tclContext->xFindExecutable(argv0); |
| 606 | tclInterp = tclContext->xCreateInterp(); |
| 607 | if( !tclInterp || |
| 608 | #if defined(USE_TCL_STUBS) |
| 609 | !Tcl_InitStubs(tclInterp, "8.4", 0) || |
| 610 | #endif |
| 611 | Tcl_InterpDeleted(tclInterp) ){ |
| 612 | Th_ErrorMessage(interp, |
| 613 | "Could not create Tcl interpreter", (const char *)"", 0); |
| 614 | return TH_ERROR; |
| 615 | } |
| 616 | tclContext->interp = tclInterp; |
| 617 |