diff --git a/src/ffi.rs b/src/ffi.rs index a7633b5..3cdffa3 100644 --- a/src/ffi.rs +++ b/src/ffi.rs @@ -16,9 +16,11 @@ //! # FFI bindings //! Direct bindings to the underlying C library functions. These should //! not be needed for most users. -use std::mem; -use std::hash; -use std::os::raw::{c_int, c_uchar, c_uint, c_void}; +use core::{mem, hash}; +use core::ffi::c_void; +use crate::types::*; +// use std::os::raw::{c_int, c_uchar, c_uint, c_void}; + /// Flag for context to enable no precomputation pub const SECP256K1_START_NONE: c_uint = 1; diff --git a/src/lib.rs b/src/lib.rs index 89c61f8..52a4e13 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -147,6 +147,7 @@ use core::{fmt, ptr, str}; #[macro_use] mod macros; +mod types; pub mod constants; pub mod ecdh; pub mod ffi; diff --git a/src/types.rs b/src/types.rs new file mode 100644 index 0000000..9bcb3b9 --- /dev/null +++ b/src/types.rs @@ -0,0 +1,5 @@ +#![allow(non_camel_case_types)] +pub type c_int = i32; +pub type c_uchar = u8; +pub type c_uint = u32; +pub use core::ffi::c_void; \ No newline at end of file