Skip to content

Commit 594b9c2

Browse files
committed
Merge pull request #52 from nazim-can-bedir/master
Added conditional support for extension loading
2 parents e8af4f6 + 99db2f8 commit 594b9c2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Database.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,21 @@ void Database::createFunction(const char* apFuncName,
156156
void Database::loadExtension(const char* apExtensionName,
157157
const char *apEntryPointName)
158158
{
159+
#ifdef SQLITE_OMIT_LOAD_EXTENSION
160+
#
161+
throw std::runtime_error("sqlite extensions are disabled");
162+
#
163+
#else
164+
#
159165
int ret = sqlite3_enable_load_extension(mpSQLite, 1);
160166

161167
check(ret);
162168

163169
ret = sqlite3_load_extension(mpSQLite, apExtensionName, apEntryPointName, 0);
164170

165171
check(ret);
172+
#
173+
#endif
166174
}
167175

168176
} // namespace SQLite

0 commit comments

Comments
 (0)