From ab8066eb1a265c9dbf636da0f4be8993aff407b1 Mon Sep 17 00:00:00 2001 From: Elichai Turkel Date: Mon, 18 Feb 2019 14:31:30 +0200 Subject: [PATCH] Replaced the std::os::raw c types with types.rs --- src/ffi.rs | 8 +++++--- src/lib.rs | 1 + src/types.rs | 5 +++++ 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 src/types.rs 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