diff options
author | mistachkin <mistachkin@noemail.net> | 2013-06-21 18:32:11 +0000 |
---|---|---|
committer | mistachkin <mistachkin@noemail.net> | 2013-06-21 18:32:11 +0000 |
commit | f5fe3ae9e6ec813a0f015c990ddac7349a933467 (patch) | |
tree | fe707c5648260e826cb61bd85e9f08501ff2ca4c /src/tclsqlite.c | |
parent | 1654256ac892447558ff0587de76d5b53ac2b6f5 (diff) | |
parent | b01e5b59a2e471d468e1854ef4de4b8f54f3bd6c (diff) | |
download | sqlite-f5fe3ae9e6ec813a0f015c990ddac7349a933467.tar.gz sqlite-f5fe3ae9e6ec813a0f015c990ddac7349a933467.zip |
Merge updates from trunk.
FossilOrigin-Name: fa2a91e6c631864846484d13cffdc51856953cd1
Diffstat (limited to 'src/tclsqlite.c')
-rw-r--r-- | src/tclsqlite.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/tclsqlite.c b/src/tclsqlite.c index f1bb2921d..6d2a51e5a 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -3050,7 +3050,7 @@ static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){ */ #ifndef USE_TCL_STUBS # undef Tcl_InitStubs -# define Tcl_InitStubs(a,b,c) +# define Tcl_InitStubs(a,b,c) TCL_VERSION #endif /* @@ -3074,19 +3074,18 @@ static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){ ** The EXTERN macros are required by TCL in order to work on windows. */ EXTERN int Sqlite3_Init(Tcl_Interp *interp){ - Tcl_InitStubs(interp, "8.4", 0); - Tcl_CreateObjCommand(interp, "sqlite3", (Tcl_ObjCmdProc*)DbMain, 0, 0); - Tcl_PkgProvide(interp, "sqlite3", PACKAGE_VERSION); - + int rc = Tcl_InitStubs(interp, "8.4", 0)==0 ? TCL_ERROR : TCL_OK; + if( rc==TCL_OK ){ + Tcl_CreateObjCommand(interp, "sqlite3", (Tcl_ObjCmdProc*)DbMain, 0, 0); #ifndef SQLITE_3_SUFFIX_ONLY - /* The "sqlite" alias is undocumented. It is here only to support - ** legacy scripts. All new scripts should use only the "sqlite3" - ** command. - */ - Tcl_CreateObjCommand(interp, "sqlite", (Tcl_ObjCmdProc*)DbMain, 0, 0); + /* The "sqlite" alias is undocumented. It is here only to support + ** legacy scripts. All new scripts should use only the "sqlite3" + ** command. */ + Tcl_CreateObjCommand(interp, "sqlite", (Tcl_ObjCmdProc*)DbMain, 0, 0); #endif - - return TCL_OK; + rc = Tcl_PkgProvide(interp, "sqlite3", PACKAGE_VERSION); + } + return rc; } EXTERN int Tclsqlite3_Init(Tcl_Interp *interp){ return Sqlite3_Init(interp); } EXTERN int Sqlite3_Unload(Tcl_Interp *interp, int flags){ return TCL_OK; } |