From bd535e94c75a8adf17638884885f74b6ce9abd71 Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Tue, 21 Sep 2021 12:32:28 +0300 Subject: [PATCH] UI: SQLite: Add config.h --- src/3rdparty/sqlite/config.h | 82 +++++++++++++++++++++++++++ src/3rdparty/sqlite/sqlite.h | 4 ++ src/ui/3rdparty/sqlite/sqlite.pri | 37 ++---------- src/ui/3rdparty/sqlite/sqlitedb.cpp | 2 +- src/ui/3rdparty/sqlite/sqlitestmt.cpp | 2 +- 5 files changed, 93 insertions(+), 34 deletions(-) create mode 100644 src/3rdparty/sqlite/config.h create mode 100644 src/3rdparty/sqlite/sqlite.h diff --git a/src/3rdparty/sqlite/config.h b/src/3rdparty/sqlite/config.h new file mode 100644 index 00000000..65c37fcf --- /dev/null +++ b/src/3rdparty/sqlite/config.h @@ -0,0 +1,82 @@ +#pragma once + +#include + +#if __has_include() +#include +#endif + +#if __has_include() +#define HAVE_UTIME 1 +#endif + +#if (_XOPEN_SOURCE >= 500) && !(_POSIX_C_SOURCE >= 200809L) || _DEFAULT_SOURCE || _BSD_SOURCE +#define HAVE_USLEEP 1 +#endif + +#ifdef _GNU_SOURCE +#define HAVE_STRCHRNUL 1 +#endif + +#if _POSIX_C_SOURCE >= 199309L || _XOPEN_SOURCE >= 500 +#define HAVE_FDATASYNC 1 +#endif + +#if _POSIX_C_SOURCE >= 1 || _BSD_SOURCE +#define HAVE_LOCALTIME_R 1 +#else +#define HAVE_LOCALTIME_S 1 +#endif + +#define HAVE_MALLOC_USABLE_SIZE 1 +#define HAVE_ISNAN 1 + +//#define SQLITE_ENABLE_FTS5 1 +//#define SQLITE_ENABLE_JSON1 1 +#define SQLITE_ENABLE_MEMORY_MANAGEMENT 1 +//#define SQLITE_ENABLE_NULL_TRIM 1 +//#define SQLITE_ENABLE_PREUPDATE_HOOK 1 +//#define SQLITE_ENABLE_SESSION 1 +#define SQLITE_ENABLE_STAT4 1 +//#define SQLITE_ENABLE_UNLOCK_NOTIFY 1 + +#define SQLITE_DEFAULT_FOREIGN_KEYS 0 +#define SQLITE_DEFAULT_LOCKING_MODE 0 +#define SQLITE_DEFAULT_MEMSTATUS 0 +#define SQLITE_DEFAULT_WAL_SYNCHRONOUS 1 + +#define SQLITE_ALLOW_COVERING_INDEX_SCAN 1 +#define SQLITE_DQS 0 +#define SQLITE_LIKE_DOESNT_MATCH_BLOBS 1 +#define SQLITE_TEMP_STORE 2 +#define SQLITE_THREADSAFE 1 +#define SQLITE_USE_ALLOCA 1 + +#define SQLITE_DEFAULT_MMAP_SIZE 268435456 +#define SQLITE_DEFAULT_CACHE_SIZE -100000 +#define SQLITE_MAX_EXPR_DEPTH 0 +#define SQLITE_MAX_WORKER_THREADS 1 +#define SQLITE_WIN32_GETVERSIONEX 0 + +#define SQLITE_OMIT_AUTHORIZATION 1 +#define SQLITE_OMIT_AUTOINIT 1 +#define SQLITE_OMIT_AUTOMATIC_INDEX 1 +#define SQLITE_OMIT_AUTORESET 1 +#define SQLITE_OMIT_BLOB_LITERAL 1 +#define SQLITE_OMIT_CAST 1 +#define SQLITE_OMIT_CHECK 1 +#define SQLITE_OMIT_COMPLETE 1 +#define SQLITE_OMIT_DECLTYPE 1 +#define SQLITE_OMIT_DEPRECATED 1 +#define SQLITE_OMIT_EXPLAIN 1 +#define SQLITE_OMIT_FOREIGN_KEY 1 +#define SQLITE_OMIT_GET_TABLE 1 +#define SQLITE_OMIT_INCRBLOB 1 +#define SQLITE_OMIT_INTEGRITY_CHECK 1 +#define SQLITE_OMIT_LOAD_EXTENSION 1 +#define SQLITE_OMIT_PROGRESS_CALLBACK 1 +#define SQLITE_OMIT_SHARED_CACHE 1 +#define SQLITE_OMIT_TCL_VARIABLE 1 +#define SQLITE_OMIT_TEMPDB 1 +#define SQLITE_OMIT_TRACE 1 +//#define SQLITE_OMIT_UTF16 1 diff --git a/src/3rdparty/sqlite/sqlite.h b/src/3rdparty/sqlite/sqlite.h new file mode 100644 index 00000000..c8f58b88 --- /dev/null +++ b/src/3rdparty/sqlite/sqlite.h @@ -0,0 +1,4 @@ +#pragma once + +#include "config.h" +#include "sqlite3.h" diff --git a/src/ui/3rdparty/sqlite/sqlite.pri b/src/ui/3rdparty/sqlite/sqlite.pri index b303eee9..0b907de9 100644 --- a/src/ui/3rdparty/sqlite/sqlite.pri +++ b/src/ui/3rdparty/sqlite/sqlite.pri @@ -1,42 +1,13 @@ CONFIG(release, debug|release) { DEFINES *= NDEBUG } else { - DEFINES += SQLITE_DEBUG + DEFINES += SQLITE_DEBUG SQLITE_ENABLE_API_ARMOR } -DEFINES += \ - SQLITE_THREADSAFE=1 \ - SQLITE_DEFAULT_LOCKING_MODE=0 \ - SQLITE_DEFAULT_MEMSTATUS=0 \ - SQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \ - SQLITE_DQS=0 \ - SQLITE_ENABLE_STAT4 \ - SQLITE_LIKE_DOESNT_MATCH_BLOBS \ - SQLITE_TEMP_STORE=2 \ - SQLITE_USE_ALLOCA \ - SQLITE_OMIT_AUTHORIZATION \ - SQLITE_OMIT_AUTOINIT \ - SQLITE_OMIT_AUTOMATIC_INDEX \ - SQLITE_OMIT_BLOB_LITERAL \ - SQLITE_OMIT_CAST \ - SQLITE_OMIT_CHECK \ - SQLITE_OMIT_COMPLETE \ - SQLITE_OMIT_DECLTYPE \ - SQLITE_OMIT_DEPRECATED \ - SQLITE_OMIT_EXPLAIN \ - SQLITE_OMIT_FOREIGN_KEY \ - SQLITE_OMIT_GET_TABLE \ - SQLITE_OMIT_INCRBLOB \ - SQLITE_OMIT_INTEGRITY_CHECK \ - SQLITE_OMIT_LOAD_EXTENSION \ - SQLITE_OMIT_PROGRESS_CALLBACK \ - SQLITE_OMIT_SHARED_CACHE \ - SQLITE_OMIT_TCL_VARIABLE \ - SQLITE_OMIT_TEMPDB \ - SQLITE_OMIT_TRACE \ - #SQLITE_OMIT_UTF16 +DEFINES += _HAVE_SQLITE_CONFIG_H SQLITE_DIR = $$PWD/../../../3rdparty/sqlite + INCLUDEPATH += $$SQLITE_DIR SOURCES += \ @@ -45,6 +16,8 @@ SOURCES += \ $$PWD/sqlitestmt.cpp HEADERS += \ + $$SQLITE_DIR/config.h \ + $$SQLITE_DIR/sqlite.h \ $$SQLITE_DIR/sqlite3.h \ $$PWD/sqlitedb.h \ $$PWD/sqlitestmt.h diff --git a/src/ui/3rdparty/sqlite/sqlitedb.cpp b/src/ui/3rdparty/sqlite/sqlitedb.cpp index af1da0c1..3235b10d 100644 --- a/src/ui/3rdparty/sqlite/sqlitedb.cpp +++ b/src/ui/3rdparty/sqlite/sqlitedb.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include "sqlitestmt.h" diff --git a/src/ui/3rdparty/sqlite/sqlitestmt.cpp b/src/ui/3rdparty/sqlite/sqlitestmt.cpp index d115a190..d5d014b9 100644 --- a/src/ui/3rdparty/sqlite/sqlitestmt.cpp +++ b/src/ui/3rdparty/sqlite/sqlitestmt.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include SqliteStmt::SqliteStmt() = default;