From b0c40df4f3ced6cac21bd45328334ba1ecd924a6 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 24 Jun 2020 13:26:29 +0100 Subject: [PATCH] rust: turn evmc_host_context instantiable --- bindings/rust/evmc-sys/build.rs | 2 +- bindings/rust/evmc-sys/src/lib.rs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bindings/rust/evmc-sys/build.rs b/bindings/rust/evmc-sys/build.rs index 6c2d9112b..a67100b4e 100644 --- a/bindings/rust/evmc-sys/build.rs +++ b/bindings/rust/evmc-sys/build.rs @@ -24,7 +24,7 @@ fn gen_bindings() { .derive_hash(true) // force deriving the PratialEq trait on basic types (address, bytes32) .derive_partialeq(true) - .opaque_type("evmc_host_context") + .blacklist_type("evmc_host_context") .whitelist_type("evmc_.*") .whitelist_function("evmc_.*") .whitelist_var("EVMC_ABI_VERSION") diff --git a/bindings/rust/evmc-sys/src/lib.rs b/bindings/rust/evmc-sys/src/lib.rs index da4751469..21900d30e 100644 --- a/bindings/rust/evmc-sys/src/lib.rs +++ b/bindings/rust/evmc-sys/src/lib.rs @@ -9,6 +9,12 @@ include!(concat!(env!("OUT_DIR"), "/bindings.rs")); +// Defining evmc_host_context here, because bindgen cannot create a useful declaration yet. + +pub type evmc_host_context = ::std::os::raw::c_void; + +//pub struct evmc_host_context { } + // TODO: add `.derive_default(true)` to bindgen instead? impl Default for evmc_address {