Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Bindgen generates this struct:
- #[repr(C)]
- #[derive(Debug, Copy, Clone)]
- pub struct pthread_mutex_t {
- pub value: ::std::os::raw::c_int,
- }
- That's valid and it works, but everytime I want to use
- this `pthread_mutex_t` type with `libc::pthread_mutex_lock()`
- I have to cast it into `libc::pthread_mutex_t`:
- let libc_mutex_ptr = &mut bindgen_mutex as *mut _ as *mut libc::pthread_mutex_t;
- This kind of cast happens all over my code. Is there a way to either:
- 1) make it so bindgen re-use libc::pthread_mutex_t instead of creating its own,
- 2) or, have an elegant way to cast from bindgen mutex to libc mutex?
Add Comment
Please, Sign In to add comment