Skip to content

Commit

Permalink
allow for header in sqlcipher folder
Browse files Browse the repository at this point in the history
  • Loading branch information
MSP-Greg committed Aug 9, 2022
1 parent 6eb115d commit bcbdf63
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 8 additions & 1 deletion ext/sqlite3/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,14 @@ def configure_extension
append_cflags("-DTAINTING_SUPPORT")
end

abort_could_not_find("sqlite3.h") unless find_header("sqlite3.h")
if find_header("sqlite3.h")
# noop
elsif find_header("#{libname}/sqlite3.h")
$defs.push "-DHAVE_LIB_FLDR"
else
abort_could_not_find("sqlite3.h")
end

abort_could_not_find(libname) unless find_library(libname, "sqlite3_libversion_number", "sqlite3.h")

# Functions defined in 1.9 but not 1.8
Expand Down
5 changes: 4 additions & 1 deletion ext/sqlite3/sqlite3_ruby.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@
#define SQLITE3_UTF8_STR_NEW2(_obj) \
(rb_enc_associate_index(rb_str_new2(_obj), rb_utf8_encindex()))


#ifdef HAVE_LIB_FLDR /* only occurs with sqlcipher? */
#include <sqlcipher/sqlite3.h>
#else
#include <sqlite3.h>
#endif

#ifndef HAVE_TYPE_SQLITE3_INT64
typedef sqlite_int64 sqlite3_int64;
Expand Down

0 comments on commit bcbdf63

Please sign in to comment.