aboutsummaryrefslogtreecommitdiff
path: root/src/tclsqlite.c
diff options
context:
space:
mode:
authormistachkin <mistachkin@noemail.net>2012-09-10 09:33:09 +0000
committermistachkin <mistachkin@noemail.net>2012-09-10 09:33:09 +0000
commit9dc2a7366229218173c64b47341b7f6ce437c939 (patch)
tree24e27f2b2e5b31d22bab852be345825077609177 /src/tclsqlite.c
parent8765b4660e77375a5c61c746e84c84c22c2eaf7f (diff)
downloadsqlite-9dc2a7366229218173c64b47341b7f6ce437c939.tar.gz
sqlite-9dc2a7366229218173c64b47341b7f6ce437c939.zip
Avoid using the sqlite3ErrStr function in the Tcl package if USE_SYSTEM_SQLITE is defined.
FossilOrigin-Name: a716b9a3091072774d067c0a1258b0f4c39a4180
Diffstat (limited to 'src/tclsqlite.c')
-rw-r--r--src/tclsqlite.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tclsqlite.c b/src/tclsqlite.c
index bb930f0c7..abec51e67 100644
--- a/src/tclsqlite.c
+++ b/src/tclsqlite.c
@@ -45,7 +45,9 @@
** This function is used to translate a return code into an error
** message.
*/
+#ifndef USE_SYSTEM_SQLITE
const char *sqlite3ErrStr(int rc);
+#endif
/*
* Windows needs to know which symbols to export. Unix does not.
@@ -3042,15 +3044,19 @@ static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
zFile = Tcl_TranslateFileName(interp, zFile, &translatedFilename);
rc = sqlite3_open_v2(zFile, &p->db, flags, zVfs);
Tcl_DStringFree(&translatedFilename);
+#ifndef USE_SYSTEM_SQLITE
if( p->db ){
+#endif
if( SQLITE_OK!=sqlite3_errcode(p->db) ){
zErrMsg = sqlite3_mprintf("%s", sqlite3_errmsg(p->db));
sqlite3_close(p->db);
p->db = 0;
}
+#ifndef USE_SYSTEM_SQLITE
}else{
zErrMsg = sqlite3_mprintf("%s", sqlite3ErrStr(rc));
}
+#endif
#ifdef SQLITE_HAS_CODEC
if( p->db ){
sqlite3_key(p->db, pKey, nKey);