Skip to content
This repository was archived by the owner on Mar 7, 2021. It is now read-only.

Commit 12d2aa5

Browse files
committed
Fixes #159 -- make the c_types module properly target aware
1 parent 2a460fa commit 12d2aa5

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

src/c_types.rs

+20-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
#![allow(non_camel_case_types)]
22

3-
use core::ffi;
3+
#[cfg(target_arch = "x86_64")]
4+
mod c {
5+
use core::ffi;
46

5-
pub type c_int = i32;
6-
pub type c_char = i8;
7-
pub type c_long = i64;
8-
pub type c_longlong = i64;
9-
pub type c_short = i16;
10-
pub type c_uchar = u8;
11-
pub type c_uint = u32;
12-
pub type c_ulong = u64;
13-
pub type c_ulonglong = u64;
14-
pub type c_ushort = u16;
15-
pub type c_schar = i8;
16-
pub type c_size_t = usize;
17-
pub type c_ssize_t = isize;
18-
pub type c_void = ffi::c_void;
7+
pub type c_int = i32;
8+
pub type c_char = i8;
9+
pub type c_long = i64;
10+
pub type c_longlong = i64;
11+
pub type c_short = i16;
12+
pub type c_uchar = u8;
13+
pub type c_uint = u32;
14+
pub type c_ulong = u64;
15+
pub type c_ulonglong = u64;
16+
pub type c_ushort = u16;
17+
pub type c_schar = i8;
18+
pub type c_size_t = usize;
19+
pub type c_ssize_t = isize;
20+
pub type c_void = ffi::c_void;
21+
}
22+
23+
pub use c::*;

0 commit comments

Comments
 (0)