From 029995f6a33135ecd66bb3ac3873293e00ac4e21 Mon Sep 17 00:00:00 2001 From: Ryan Flynn Date: Fri, 4 Jan 2013 14:58:52 -0500 Subject: [PATCH] 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 --- c_src/sqlite3_drv.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/c_src/sqlite3_drv.c b/c_src/sqlite3_drv.c index a09fbef..5e048ae 100644 --- a/c_src/sqlite3_drv.c +++ b/c_src/sqlite3_drv.c @@ -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(