mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-05 02:06:02 -04:00
Added conditional support for extension loading
This commit is contained in:
parent
e8af4f6738
commit
99db2f8bdb
@ -156,6 +156,12 @@ void Database::createFunction(const char* apFuncName,
|
|||||||
void Database::loadExtension(const char* apExtensionName,
|
void Database::loadExtension(const char* apExtensionName,
|
||||||
const char *apEntryPointName)
|
const char *apEntryPointName)
|
||||||
{
|
{
|
||||||
|
#ifdef SQLITE_OMIT_LOAD_EXTENSION
|
||||||
|
#
|
||||||
|
throw std::runtime_error("sqlite extensions are disabled");
|
||||||
|
#
|
||||||
|
#else
|
||||||
|
#
|
||||||
int ret = sqlite3_enable_load_extension(mpSQLite, 1);
|
int ret = sqlite3_enable_load_extension(mpSQLite, 1);
|
||||||
|
|
||||||
check(ret);
|
check(ret);
|
||||||
@ -163,6 +169,8 @@ void Database::loadExtension(const char* apExtensionName,
|
|||||||
ret = sqlite3_load_extension(mpSQLite, apExtensionName, apEntryPointName, 0);
|
ret = sqlite3_load_extension(mpSQLite, apExtensionName, apEntryPointName, 0);
|
||||||
|
|
||||||
check(ret);
|
check(ret);
|
||||||
|
#
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace SQLite
|
} // namespace SQLite
|
||||||
|
Loading…
x
Reference in New Issue
Block a user