error_code/
types.rs

1//! C types used inside crate
2#![allow(non_camel_case_types)]
3
4//https://github.com/rust-lang/rust/blob/7b4d9e155fec06583c763f176fc432dc779f1fc6/library/core/src/ffi/mod.rs#L166
5#[cfg(any(target_arch = "avr", target_arch = "msp430"))]
6mod ints {
7    ///C type `int`
8    pub type c_int = i16;
9    ///C type `unsigned int`
10    pub type c_uint = u16;
11}
12
13#[cfg(not(any(target_arch = "avr", target_arch = "msp430")))]
14mod ints {
15    ///C type `int`
16    pub type c_int = i32;
17    ///C type `unsigned int`
18    pub type c_uint = u32;
19}
20
21#[cfg(all(target_pointer_width = "64", not(windows)))]
22mod longs {
23    ///C type `unsigned long`
24    pub type c_ulong = u64;
25}
26#[cfg(not(all(target_pointer_width = "64", not(windows))))]
27mod longs {
28    ///C type `unsigned long`
29    pub type c_ulong = u32;
30}
31
32pub use ints::*;
33pub use longs::*;