Skip to content

Commit

Permalink
Merge pull request #524 from ethereum/rust-host-context
Browse files Browse the repository at this point in the history
rust: turn evmc_host_context into a void type
  • Loading branch information
axic authored May 22, 2022
2 parents 1982c04 + e47280b commit 4b1dbad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bindings/rust/evmc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,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")
.blocklist_type("evmc_host_context")
.allowlist_type("evmc_.*")
.allowlist_function("evmc_.*")
.allowlist_var("EVMC_ABI_VERSION")
Expand Down
5 changes: 5 additions & 0 deletions bindings/rust/evmc-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

include!(concat!(env!("OUT_DIR"), "/bindings.rs"));

// Defining evmc_host_context here, because bindgen cannot create a useful declaration yet.

/// This is a void type given host context is an opaque pointer. Functions allow it to be a null ptr.
pub type evmc_host_context = ::std::os::raw::c_void;

// TODO: add `.derive_default(true)` to bindgen instead?

impl Default for evmc_address {
Expand Down

0 comments on commit 4b1dbad

Please sign in to comment.