Skip to content
This repository was archived by the owner on Sep 13, 2023. It is now read-only.

Commit df2cd56

Browse files
authored
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 rust-lang/rust-bindgen#1620. * Make binding generation work properly on Windows too.
1 parent f0fa429 commit df2cd56

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

lmdb-sys/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ readme = "../README.md"
1212
keywords = ["LMDB", "database", "storage-engine", "bindings", "library"]
1313
categories = ["database", "external-ffi-bindings"]
1414

15-
# NB: Use "--feature bindgen" to generate bindings.
15+
# NB: Use "--features bindgen" to generate bindings.
1616
build = "build.rs"
1717

1818
[lib]
@@ -28,7 +28,7 @@ libc = "0.2"
2828
[build-dependencies]
2929
pkg-config = "0.3"
3030
cc = "1.0"
31-
bindgen = { version = "0.53.2", default-features = false, optional = true }
31+
bindgen = { version = "0.53.2", default-features = false, optional = true, features = ["runtime"] }
3232

3333
[features]
3434
default = []

lmdb-sys/bindgen.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ pub fn generate() {
5353
.size_t_is_usize(true)
5454
.ctypes_prefix("::libc")
5555
.blacklist_item("mode_t")
56-
.blacklist_item("filehandle_t")
56+
.blacklist_item("mdb_mode_t")
57+
.blacklist_item("mdb_filehandle_t")
5758
.blacklist_item("^__.*")
5859
.parse_callbacks(Box::new(Callbacks {}))
5960
.layout_tests(false)

lmdb-sys/src/bindings.rs

-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ pub const MDB_BAD_TXN: ::libc::c_int = -30782;
5252
pub const MDB_BAD_VALSIZE: ::libc::c_int = -30781;
5353
pub const MDB_BAD_DBI: ::libc::c_int = -30780;
5454
pub const MDB_LAST_ERRCODE: ::libc::c_int = -30780;
55-
pub type mdb_mode_t = mode_t;
56-
pub type mdb_filehandle_t = ::libc::c_int;
5755
#[repr(C)]
5856
#[derive(Debug, Copy, Clone)]
5957
pub struct MDB_env {

lmdb-sys/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ extern crate libc;
77

88
#[cfg(unix)]
99
#[allow(non_camel_case_types)]
10-
pub type mode_t = ::libc::mode_t;
10+
pub type mdb_mode_t = ::libc::mode_t;
1111
#[cfg(windows)]
1212
#[allow(non_camel_case_types)]
13-
pub type mode_t = ::libc::c_int;
13+
pub type mdb_mode_t = ::libc::c_int;
1414

1515
#[cfg(unix)]
1616
#[allow(non_camel_case_types)]
17-
pub type filehandle_t = ::libc::c_int;
17+
pub type mdb_filehandle_t = ::libc::c_int;
1818
#[cfg(windows)]
1919
#[allow(non_camel_case_types)]
20-
pub type filehandle_t = *mut ::libc::c_void;
20+
pub type mdb_filehandle_t = *mut ::libc::c_void;
2121

2222
include!("bindings.rs");

0 commit comments

Comments
 (0)