Relax sqlite version check to major version only

iOS 8.2 updates the included SQLite version to 3.8.4, while iOS 7.0 up
to iOS 8.1 provides version 3.7.13. When compiling with the 8.2 SDK and
running on 8.1 or below, or vice versa, a strict check fails.

Fixes #968.
This commit is contained in:
John Firebaugh
2015-03-11 10:18:27 -07:00
parent 24c7239e35
commit bb73dbcd30

View File

@@ -6,20 +6,13 @@
// Check sqlite3 library version.
const static bool sqliteVersionCheck = []() {
if (sqlite3_libversion_number() != SQLITE_VERSION_NUMBER) {
if (sqlite3_libversion_number() / 1000000 != SQLITE_VERSION_NUMBER / 1000000) {
char message[96];
snprintf(message, 96,
"sqlite3 libversion mismatch: headers report %d, but library reports %d",
SQLITE_VERSION_NUMBER, sqlite3_libversion_number());
throw std::runtime_error(message);
}
if (strcmp(sqlite3_sourceid(), SQLITE_SOURCE_ID) != 0) {
char message[256];
snprintf(message, 256,
"sqlite3 sourceid mismatch: headers report \"%s\", but library reports \"%s\"",
SQLITE_SOURCE_ID, sqlite3_sourceid());
throw std::runtime_error(message);
}
return true;
}();