diff options
author | drh <drh@noemail.net> | 2009-10-13 18:38:34 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2009-10-13 18:38:34 +0000 |
commit | a2c8a95b1c32c5c5099da5a11cc2accbb0e5e3b1 (patch) | |
tree | b3e452dca4b449c4e935d1b5c1388b015105828b /src/tclsqlite.c | |
parent | ccd62aa0e340bdec7ad123a4f89aed7c23abd907 (diff) | |
download | sqlite-a2c8a95b1c32c5c5099da5a11cc2accbb0e5e3b1.tar.gz sqlite-a2c8a95b1c32c5c5099da5a11cc2accbb0e5e3b1.zip |
Update the TCL wrapper to provide a non-NULL objProc pointer to the
Tcl_NRCreateCommand() interface. The TCL gurus say this is needed to
support legacy TCL extensions.
FossilOrigin-Name: 1b3cfa01dd7fb9a48f0008f5afd974db61c30cff
Diffstat (limited to 'src/tclsqlite.c')
-rw-r--r-- | src/tclsqlite.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/tclsqlite.c b/src/tclsqlite.c index dea1d90df..5f5517ac2 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -1415,6 +1415,7 @@ static Tcl_Obj *dbEvalColumnValue(DbEvalContext *p, int iCol){ ** This allows stubs-enabled builds to be used with older Tcl libraries. */ #if TCL_MAJOR_VERSION>8 || (TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION>=6) +# define SQLITE_TCL_NRE 1 static int DbUseNre(void){ int major, minor; Tcl_GetVersion(&major, &minor, 0, 0); @@ -1430,6 +1431,7 @@ static int DbUseNre(void){ ** ** if( DbUseNre() ) { ... } */ +# define SQLITE_TCL_NRE 0 # define DbUseNre() 0 # define Tcl_NRAddCallback(a,b,c,d,e,f) 0 # define Tcl_NREvalObj(a,b,c) 0 @@ -2764,6 +2766,21 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){ return rc; } +#if SQLITE_TCL_NRE +/* +** Adaptor that provides an objCmd interface to the NRE-enabled +** interface implementation. +*/ +static int DbObjCmdAdaptor( + void *cd, + Tcl_Interp *interp, + int objc, + Tcl_Obj *const*objv +){ + return Tcl_NRCallObjProc(interp, DbObjCmd, cd, objc, objv); +} +#endif /* SQLITE_TCL_NRE */ + /* ** sqlite3 DBNAME FILENAME ?-vfs VFSNAME? ?-key KEY? ?-readonly BOOLEAN? ** ?-create BOOLEAN? ?-nomutex BOOLEAN? @@ -2907,7 +2924,8 @@ static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){ p->interp = interp; zArg = Tcl_GetStringFromObj(objv[1], 0); if( DbUseNre() ){ - Tcl_NRCreateCommand(interp, zArg, 0, DbObjCmd, (char*)p, DbDeleteCmd); + Tcl_NRCreateCommand(interp, zArg, DbObjCmdAdaptor, DbObjCmd, + (char*)p, DbDeleteCmd); }else{ Tcl_CreateObjCommand(interp, zArg, DbObjCmd, (char*)p, DbDeleteCmd); } |