issue #17: solve Symbol not found: _sqlite3_enable_load_extension by #ifdef-ing it out by default; erlang-sqlite3 will need configure-esque feature detection via http://www.sqlite.org/c3ref/compileoption_get.html or http://www.sqlite.org/pragma.html#pragma_compile_options

This commit is contained in:
Ryan Flynn
2013-01-04 14:58:52 -05:00
committed by Ryan Flynn
parent 5a2bb57854
commit 029995f6a3

View File

@@ -246,12 +246,16 @@ static inline int output_ok(sqlite3_drv_t *drv) {
return driver_output_term(drv->port, spec, sizeof(spec) / sizeof(spec[0]));
}
static int enable_load_extension(sqlite3_drv_t* drv, char *buf,
int len) {
static int enable_load_extension(sqlite3_drv_t* drv, char *buf, int len) {
#ifdef ERLANG_SQLITE3_LOAD_EXTENSION
char enable = buf[0];
sqlite3_enable_load_extension(drv->db, (int) enable);
output_ok(drv);
return 0;
#else
output_error(drv, SQLITE_MISUSE, "extension loading not enabled");
return -1;
#endif
}
static inline async_sqlite3_command *make_async_command_statement(