From e0a1ccb64a637673195804513902cba6b1d4e97c Mon Sep 17 00:00:00 2001 From: Niall Sheridan Date: Mon, 31 Oct 2016 16:36:17 +0000 Subject: Update dependencies --- vendor/github.com/mattn/go-sqlite3/backup.go | 9 +++++++-- vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c | 5 +++++ vendor/github.com/mattn/go-sqlite3/sqlite3-binding.h | 5 +++++ vendor/github.com/mattn/go-sqlite3/sqlite3.go | 2 +- vendor/github.com/mattn/go-sqlite3/sqlite3ext.h | 11 ++++++++--- 5 files changed, 26 insertions(+), 6 deletions(-) (limited to 'vendor/github.com/mattn/go-sqlite3') diff --git a/vendor/github.com/mattn/go-sqlite3/backup.go b/vendor/github.com/mattn/go-sqlite3/backup.go index 4c1e38c..05f8038 100644 --- a/vendor/github.com/mattn/go-sqlite3/backup.go +++ b/vendor/github.com/mattn/go-sqlite3/backup.go @@ -65,10 +65,15 @@ func (b *SQLiteBackup) Finish() error { func (b *SQLiteBackup) Close() error { ret := C.sqlite3_backup_finish(b.b) + + // sqlite3_backup_finish() never fails, it just returns the + // error code from previous operations, so clean up before + // checking and returning an error + b.b = nil + runtime.SetFinalizer(b, nil) + if ret != 0 { return Error{Code: ErrNo(ret)} } - b.b = nil - runtime.SetFinalizer(b, nil) return nil } diff --git a/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c b/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c index 1f085b0..a8790de 100644 --- a/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c +++ b/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c @@ -17,6 +17,7 @@ ** language. The code for the "sqlite3" command-line shell is also in a ** separate file. This file contains only code for the core SQLite library. */ +#ifndef USE_LIBSQLITE3 #define SQLITE_CORE 1 #define SQLITE_AMALGAMATION 1 #ifndef SQLITE_PRIVATE @@ -197846,5 +197847,9 @@ static int sqlite3Fts5VocabInit(Fts5Global *pGlobal, sqlite3 *db){ #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS5) */ +#else // USE_LIBSQLITE3 +// If users really want to link against the system sqlite3 we +// need to make this file a noop. +#endif /************** End of fts5.c ************************************************/ diff --git a/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.h b/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.h index 4e2df5e..430ffee 100644 --- a/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.h +++ b/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.h @@ -30,6 +30,7 @@ ** the version number) and changes its name to "sqlite3.h" as ** part of the build process. */ +#ifndef USE_LIBSQLITE3 #ifndef SQLITE3_H #define SQLITE3_H #include /* Needed for the definition of va_list */ @@ -10338,5 +10339,9 @@ struct fts5_api { #endif #endif /* _FTS5_H */ +#else // USE_LIBSQLITE3 +// If users really want to link against the system sqlite3 we +// need to make this file a noop. +#endif /******** End of fts5.h *********/ diff --git a/vendor/github.com/mattn/go-sqlite3/sqlite3.go b/vendor/github.com/mattn/go-sqlite3/sqlite3.go index af4c68d..de9d7d2 100644 --- a/vendor/github.com/mattn/go-sqlite3/sqlite3.go +++ b/vendor/github.com/mattn/go-sqlite3/sqlite3.go @@ -10,7 +10,7 @@ package sqlite3 #cgo CFLAGS: -DSQLITE_ENABLE_RTREE -DSQLITE_THREADSAFE #cgo CFLAGS: -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4_UNICODE61 #cgo CFLAGS: -DSQLITE_TRACE_SIZE_LIMIT=15 -#cgo CFLAGS: -Wno-deprecated-declarations -Wno-c99-extensions +#cgo CFLAGS: -Wno-deprecated-declarations #ifndef USE_LIBSQLITE3 #include #else diff --git a/vendor/github.com/mattn/go-sqlite3/sqlite3ext.h b/vendor/github.com/mattn/go-sqlite3/sqlite3ext.h index ce87e74..0c28610 100644 --- a/vendor/github.com/mattn/go-sqlite3/sqlite3ext.h +++ b/vendor/github.com/mattn/go-sqlite3/sqlite3ext.h @@ -1,3 +1,4 @@ +#ifndef USE_LIBSQLITE3 /* ** 2006 June 7 ** @@ -12,7 +13,7 @@ ** This header file defines the SQLite interface for use by ** shared libraries that want to be imported as extensions into ** an SQLite instance. Shared libraries that intend to be loaded -** as extensions by SQLite should #include this file instead of +** as extensions by SQLite should #include this file instead of ** sqlite3.h. */ #ifndef SQLITE3EXT_H @@ -543,14 +544,14 @@ typedef int (*sqlite3_loadext_entry)( #endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */ #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) - /* This case when the file really is being compiled as a loadable + /* This case when the file really is being compiled as a loadable ** extension */ # define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api=0; # define SQLITE_EXTENSION_INIT2(v) sqlite3_api=v; # define SQLITE_EXTENSION_INIT3 \ extern const sqlite3_api_routines *sqlite3_api; #else - /* This case when the file is being statically linked into the + /* This case when the file is being statically linked into the ** application */ # define SQLITE_EXTENSION_INIT1 /*no-op*/ # define SQLITE_EXTENSION_INIT2(v) (void)v; /* unused parameter */ @@ -558,3 +559,7 @@ typedef int (*sqlite3_loadext_entry)( #endif #endif /* SQLITE3EXT_H */ +#else // USE_LIBSQLITE3 + // If users really want to link against the system sqlite3 we +// need to make this file a noop. + #endif -- cgit v1.2.3