Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rust: turn evmc_host_context into a void type #524

Merged
merged 1 commit into from
May 22, 2022
Merged

Conversation

axic
Copy link
Member

@axic axic commented Jun 24, 2020

This may be needed for #476.


pub type evmc_host_context = ::std::os::raw::c_void;

//pub struct evmc_host_context { }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also just implement Default on this.


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;
Copy link
Member Author

@axic axic Jun 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this is the best option, given this is a completely opaque type, unless there is something like raw::intptr.

@CaptainVincent
Copy link

This may be needed for #476.

Yes, #476 need evmc_host_context instantiable. I will replace my workaround after this PR merged. Thank you for informing me.

@axic
Copy link
Member Author

axic commented Jun 25, 2020

@CaptainVincent do you want to make a PR so we can discuss it?

@CaptainVincent
Copy link

CaptainVincent commented Jun 26, 2020

@CaptainVincent do you want to make a PR so we can discuss it?

Done. #527. (Include evmc-client and workaround)

@axic
Copy link
Member Author

axic commented May 6, 2022

@vorot93 this is an old outstanding change, but do you have any suggestion?

What bindgen generates is the following:

#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq)]
pub struct evmc_host_context {
    _unused: [u8; 0],
}

We want something what can be "instantiated".

@codecov
Copy link

codecov bot commented May 6, 2022

Codecov Report

Merging #524 (e47280b) into master (1982c04) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #524   +/-   ##
=======================================
  Coverage   92.86%   92.86%           
=======================================
  Files          23       23           
  Lines        3546     3546           
  Branches      375      375           
=======================================
  Hits         3293     3293           
  Misses        144      144           
  Partials      109      109           

@axic axic changed the title rust: turn evmc_host_context instantiable rust: turn evmc_host_context into a void type May 21, 2022
@axic axic marked this pull request as ready for review May 21, 2022 13:32
@axic axic requested review from chfast and gumb0 May 21, 2022 13:38
@axic axic merged commit 4b1dbad into master May 22, 2022
@axic axic deleted the rust-host-context branch May 22, 2022 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants