Skip to content

Commit

Permalink
Merge rust-lang#11
Browse files Browse the repository at this point in the history
11: Re-export core::ffi::c_void r=japaric a=jeikabu

japaric/cty#10

Without this trying to use bindgen like:
```rust
let bindings = bindgen::Builder::default()
        .header("wrapper.h")
        .ctypes_prefix("cty")
        .use_core()
        .generate();
```

Results in lots of:
```
error[E0308]: mismatched types
  --> runng/src/protocol/mod.rs:49:43
   |
49 |         let res = nng_setopt(socket, opt, topic_ptr, topic_size);
   |                                           ^^^^^^^^^ expected enum `cty::c_void`, found enum `std::ffi::c_void`
   |
   = note: expected type `*const cty::c_void`
              found type `*const std::ffi::c_void`
```


Co-authored-by: jake <jeikabu@gmail.com>
  • Loading branch information
bors[bot] and jeikabu committed Feb 5, 2019
2 parents 26e59de + 1328396 commit b613a06
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,4 @@ pub type intptr_t = isize;
pub type uintptr_t = usize;
pub type ssize_t = isize;

// NOTE from libc v0.2.23
// Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help enable
// more optimization opportunities around it recognizing things like
// malloc/free.
#[repr(u8)]
pub enum c_void {
// Two dummy variants so the #[repr] attribute can be used.
#[doc(hidden)]
__variant1,
#[doc(hidden)]
__variant2,
}
pub type c_void = core::ffi::c_void;

0 comments on commit b613a06

Please sign in to comment.