Skip to content

Commit f6b3225

Browse files
committed
Fix build with system provided lib older than SQlite 3.31.0 from 2020-01-22
1 parent e779e68 commit f6b3225

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

include/SQLiteCpp/Database.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ extern const int OPEN_FULLMUTEX; // SQLITE_OPEN_FULLMUTEX
5757
extern const int OPEN_SHAREDCACHE; // SQLITE_OPEN_SHAREDCACHE
5858
/// Open database with shared cache disabled
5959
extern const int OPEN_PRIVATECACHE; // SQLITE_OPEN_PRIVATECACHE
60-
/// Database filename is not allowed to be a symbolic link
60+
/// Database filename is not allowed to be a symbolic link (Note: only since SQlite 3.31.0 from 2020-01-22)
6161
extern const int OPEN_NOFOLLOW; // SQLITE_OPEN_NOFOLLOW
6262

6363

src/Database.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ const int OPEN_NOMUTEX = SQLITE_OPEN_NOMUTEX;
3636
const int OPEN_FULLMUTEX = SQLITE_OPEN_FULLMUTEX;
3737
const int OPEN_SHAREDCACHE = SQLITE_OPEN_SHAREDCACHE;
3838
const int OPEN_PRIVATECACHE = SQLITE_OPEN_PRIVATECACHE;
39+
#if SQLITE_VERSION_NUMBER >= 3031000
3940
const int OPEN_NOFOLLOW = SQLITE_OPEN_NOFOLLOW;
41+
#else
42+
const int OPEN_NOFOLLOW = 0;
43+
#endif
4044

4145
const int OK = SQLITE_OK;
4246

0 commit comments

Comments
 (0)