Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ libc = "0.2"
linkme = "0.3"

[build-dependencies]
bindgen = "0.70"
bindgen = "0.72"

[lib]
crate-type = ["rlib"]
Expand Down
19 changes: 15 additions & 4 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,23 @@ fn main() {

let output_dir = env::var("OUT_DIR").expect("Can not find out directory");

let build = bindgen::Builder::default();

let bindings = build
let mut build = bindgen::Builder::default()
.header("src/mr.h")
.size_t_is_usize(true)
.layout_tests(false)
.layout_tests(false);

if std::env::consts::OS == "macos" {
if let Ok(output) = Command::new("xcrun").args(["--show-sdk-path"]).output() {
if let Ok(sysroot) = String::from_utf8(output.stdout) {
let sysroot = sysroot.trim();
if !sysroot.is_empty() {
build = build.clang_arg(format!("-isysroot{sysroot}"));
}
}
}
}

let bindings = build
.generate()
.expect("error generating bindings");

Expand Down
1 change: 1 addition & 0 deletions src/cluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ int MR_IsClusterInitialize();

size_t MR_ClusterGetSize();


int MR_ClusterInit(RedisModuleCtx* rctx, char *password);

size_t MR_ClusterGetSlotByKey(const char* key, size_t len);
Expand Down
Loading