Skip to content

Commit ab8066e

Browse files
committed
Replaced the std::os::raw c types with types.rs
1 parent 11ce866 commit ab8066e

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src/ffi.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
//! # FFI bindings
1717
//! Direct bindings to the underlying C library functions. These should
1818
//! not be needed for most users.
19-
use std::mem;
20-
use std::hash;
21-
use std::os::raw::{c_int, c_uchar, c_uint, c_void};
19+
use core::{mem, hash};
20+
use core::ffi::c_void;
21+
use crate::types::*;
22+
// use std::os::raw::{c_int, c_uchar, c_uint, c_void};
23+
2224

2325
/// Flag for context to enable no precomputation
2426
pub const SECP256K1_START_NONE: c_uint = 1;

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ use core::{fmt, ptr, str};
147147

148148
#[macro_use]
149149
mod macros;
150+
mod types;
150151
pub mod constants;
151152
pub mod ecdh;
152153
pub mod ffi;

src/types.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#![allow(non_camel_case_types)]
2+
pub type c_int = i32;
3+
pub type c_uchar = u8;
4+
pub type c_uint = u32;
5+
pub use core::ffi::c_void;

0 commit comments

Comments
 (0)