Fix bindings. (#77)

* Fix bindings.

PR #74 introduced a manually-generated change to the bindings that I
accidentally broke in #76.

* Specify the "runtime" feature of bindgen.

As it became non-default in https://github.com/rust-lang/rust-bindgen/pull/1620.

* Make binding generation work properly on Windows too.
without.crypto
Emilio Cobos Álvarez 4 years ago committed by GitHub
parent f0fa429eaa
commit df2cd5646f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      lmdb-sys/Cargo.toml
  2. 3
      lmdb-sys/bindgen.rs
  3. 2
      lmdb-sys/src/bindings.rs
  4. 8
      lmdb-sys/src/lib.rs

@ -12,7 +12,7 @@ readme = "../README.md"
keywords = ["LMDB", "database", "storage-engine", "bindings", "library"]
categories = ["database", "external-ffi-bindings"]
# NB: Use "--feature bindgen" to generate bindings.
# NB: Use "--features bindgen" to generate bindings.
build = "build.rs"
[lib]
@ -28,7 +28,7 @@ libc = "0.2"
[build-dependencies]
pkg-config = "0.3"
cc = "1.0"
bindgen = { version = "0.53.2", default-features = false, optional = true }
bindgen = { version = "0.53.2", default-features = false, optional = true, features = ["runtime"] }
[features]
default = []

@ -53,7 +53,8 @@ pub fn generate() {
.size_t_is_usize(true)
.ctypes_prefix("::libc")
.blacklist_item("mode_t")
.blacklist_item("filehandle_t")
.blacklist_item("mdb_mode_t")
.blacklist_item("mdb_filehandle_t")
.blacklist_item("^__.*")
.parse_callbacks(Box::new(Callbacks {}))
.layout_tests(false)

@ -52,8 +52,6 @@ pub const MDB_BAD_TXN: ::libc::c_int = -30782;
pub const MDB_BAD_VALSIZE: ::libc::c_int = -30781;
pub const MDB_BAD_DBI: ::libc::c_int = -30780;
pub const MDB_LAST_ERRCODE: ::libc::c_int = -30780;
pub type mdb_mode_t = mode_t;
pub type mdb_filehandle_t = ::libc::c_int;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MDB_env {

@ -7,16 +7,16 @@ extern crate libc;
#[cfg(unix)]
#[allow(non_camel_case_types)]
pub type mode_t = ::libc::mode_t;
pub type mdb_mode_t = ::libc::mode_t;
#[cfg(windows)]
#[allow(non_camel_case_types)]
pub type mode_t = ::libc::c_int;
pub type mdb_mode_t = ::libc::c_int;
#[cfg(unix)]
#[allow(non_camel_case_types)]
pub type filehandle_t = ::libc::c_int;
pub type mdb_filehandle_t = ::libc::c_int;
#[cfg(windows)]
#[allow(non_camel_case_types)]
pub type filehandle_t = *mut ::libc::c_void;
pub type mdb_filehandle_t = *mut ::libc::c_void;
include!("bindings.rs");

Loading…
Cancel
Save