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(