added configure check and support for sqlite3 libraries without sqlite3_prepare_v2

This commit is contained in:
Martin Willi
2008-05-07 14:41:13 +00:00
parent 4ce78f9356
commit f8277a8370
2 changed files with 14 additions and 3 deletions
@@ -53,8 +53,12 @@ static sqlite3_stmt* run(private_sqlite_database_t *this, char *sql,
{
sqlite3_stmt *stmt = NULL;
int params, i, res = SQLITE_OK;
#ifdef HAVE_SQLITE3_PREPARE_V2
if (sqlite3_prepare_v2(this->db, sql, -1, &stmt, NULL) == SQLITE_OK)
#else
if (sqlite3_prepare(this->db, sql, -1, &stmt, NULL) == SQLITE_OK)
#endif
{
params = sqlite3_bind_parameter_count(stmt);
for (i = 1; i <= params; i++)