From f6b32259f2d3733b645049b015152322ba4c2694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rombauts?= Date: Mon, 18 Jan 2021 13:05:56 +0100 Subject: [PATCH] Fix build with system provided lib older than SQlite 3.31.0 from 2020-01-22 --- include/SQLiteCpp/Database.h | 2 +- src/Database.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/SQLiteCpp/Database.h b/include/SQLiteCpp/Database.h index beb36265..1490fd83 100644 --- a/include/SQLiteCpp/Database.h +++ b/include/SQLiteCpp/Database.h @@ -57,7 +57,7 @@ extern const int OPEN_FULLMUTEX; // SQLITE_OPEN_FULLMUTEX extern const int OPEN_SHAREDCACHE; // SQLITE_OPEN_SHAREDCACHE /// Open database with shared cache disabled extern const int OPEN_PRIVATECACHE; // SQLITE_OPEN_PRIVATECACHE -/// Database filename is not allowed to be a symbolic link +/// Database filename is not allowed to be a symbolic link (Note: only since SQlite 3.31.0 from 2020-01-22) extern const int OPEN_NOFOLLOW; // SQLITE_OPEN_NOFOLLOW diff --git a/src/Database.cpp b/src/Database.cpp index 0f3842d7..7b81f8b9 100644 --- a/src/Database.cpp +++ b/src/Database.cpp @@ -36,7 +36,11 @@ const int OPEN_NOMUTEX = SQLITE_OPEN_NOMUTEX; const int OPEN_FULLMUTEX = SQLITE_OPEN_FULLMUTEX; const int OPEN_SHAREDCACHE = SQLITE_OPEN_SHAREDCACHE; const int OPEN_PRIVATECACHE = SQLITE_OPEN_PRIVATECACHE; +#if SQLITE_VERSION_NUMBER >= 3031000 const int OPEN_NOFOLLOW = SQLITE_OPEN_NOFOLLOW; +#else +const int OPEN_NOFOLLOW = 0; +#endif const int OK = SQLITE_OK;