diff --git a/src/cloudabi/mod.rs b/src/cloudabi/mod.rs index 81919675581fbfc6d9196c6ac599332d89683d31..0d8696210947e60d7988e466ac6f785c1ac2bb56 100644 --- a/src/cloudabi/mod.rs +++ b/src/cloudabi/mod.rs @@ -1,12 +1,3 @@ -pub type int8_t = i8; -pub type int16_t = i16; -pub type int32_t = i32; -pub type int64_t = i64; -pub type uint8_t = u8; -pub type uint16_t = u16; -pub type uint32_t = u32; -pub type uint64_t = u64; - pub type c_schar = i8; pub type c_uchar = u8; pub type c_short = i16; diff --git a/src/fixed_width_ints.rs b/src/fixed_width_ints.rs new file mode 100644 index 0000000000000000000000000000000000000000..9b5a13c011934078f55c14c5236c9ab519e2c1aa --- /dev/null +++ b/src/fixed_width_ints.rs @@ -0,0 +1,12 @@ +//! This module contains type aliases for C's fixed-width integer types . +//! +//! These aliases are deprecated: use the Rust types instead. + +pub type int8_t = i8; +pub type int16_t = i16; +pub type int32_t = i32; +pub type int64_t = i64; +pub type uint8_t = u8; +pub type uint16_t = u16; +pub type uint32_t = u32; +pub type uint64_t = u64; diff --git a/src/fuchsia/mod.rs b/src/fuchsia/mod.rs index 2ce2f408c0daa57ab8adaf3ef204198937e23ac3..3f4fbafbdfe42f25a95b353b4883bd8e3587464d 100644 --- a/src/fuchsia/mod.rs +++ b/src/fuchsia/mod.rs @@ -5,15 +5,6 @@ // PUB_TYPE -pub type int8_t = i8; -pub type int16_t = i16; -pub type int32_t = i32; -pub type int64_t = i64; -pub type uint8_t = u8; -pub type uint16_t = u16; -pub type uint32_t = u32; -pub type uint64_t = u64; - pub type c_schar = i8; pub type c_uchar = u8; pub type c_short = i16; diff --git a/src/hermit/mod.rs b/src/hermit/mod.rs index 3e15175a585c5f64f48dd2f0728316c641f0d6f0..9880b50723e946b2b4f20d9eced17f889e3cfc3f 100644 --- a/src/hermit/mod.rs +++ b/src/hermit/mod.rs @@ -13,15 +13,6 @@ // Ported by Colin Fink <colin.finck@rwth-aachen.de> // and Stefan Lankes <slankes@eonerc.rwth-aachen.de> -pub type int8_t = i8; -pub type int16_t = i16; -pub type int32_t = i32; -pub type int64_t = i64; -pub type uint8_t = u8; -pub type uint16_t = u16; -pub type uint32_t = u32; -pub type uint64_t = u64; - pub type c_schar = i8; pub type c_uchar = u8; pub type c_short = i16; diff --git a/src/lib.rs b/src/lib.rs index baf63243415dcb34282bf9c44275aed4691809a5..2dc42702fcb7d181a9b023a0918cc654c0d4194b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -90,27 +90,51 @@ cfg_if! { cfg_if! { if #[cfg(windows)] { + mod fixed_width_ints; + pub use fixed_width_ints::*; + mod windows; pub use windows::*; } else if #[cfg(target_os = "cloudabi")] { + mod fixed_width_ints; + pub use fixed_width_ints::*; + mod cloudabi; pub use cloudabi::*; } else if #[cfg(target_os = "fuchsia")] { + mod fixed_width_ints; + pub use fixed_width_ints::*; + mod fuchsia; pub use fuchsia::*; } else if #[cfg(target_os = "switch")] { + mod fixed_width_ints; + pub use fixed_width_ints::*; + mod switch; pub use switch::*; } else if #[cfg(unix)] { + mod fixed_width_ints; + pub use fixed_width_ints::*; + mod unix; pub use unix::*; } else if #[cfg(target_os = "hermit")] { + mod fixed_width_ints; + pub use fixed_width_ints::*; + mod hermit; pub use hermit::*; } else if #[cfg(all(target_env = "sgx", target_vendor = "fortanix"))] { + mod fixed_width_ints; + pub use fixed_width_ints::*; + mod sgx; pub use sgx::*; } else if #[cfg(any(target_env = "wasi", target_os = "wasi"))] { + mod fixed_width_ints; + pub use fixed_width_ints::*; + mod wasi; pub use wasi::*; } else { diff --git a/src/sgx.rs b/src/sgx.rs index 8a69ad36e48b6c09d6d2dbbe8dcd75691509f336..7da6269399d9e5d598fc91412932e9dd78e24057 100644 --- a/src/sgx.rs +++ b/src/sgx.rs @@ -1,14 +1,5 @@ //! SGX C types definition -pub type int8_t = i8; -pub type int16_t = i16; -pub type int32_t = i32; -pub type int64_t = i64; -pub type uint8_t = u8; -pub type uint16_t = u16; -pub type uint32_t = u32; -pub type uint64_t = u64; - pub type c_schar = i8; pub type c_uchar = u8; pub type c_short = i16; diff --git a/src/switch.rs b/src/switch.rs index 06fa2030cdf569956fa773d2bc835338ab74bb8a..801b8ed56e5908dabc06a15e73b24675eb0a223c 100644 --- a/src/switch.rs +++ b/src/switch.rs @@ -1,14 +1,5 @@ //! Switch C type definitions -pub type int8_t = i8; -pub type int16_t = i16; -pub type int32_t = i32; -pub type int64_t = i64; -pub type uint8_t = u8; -pub type uint16_t = u16; -pub type uint32_t = u32; -pub type uint64_t = u64; - pub type c_schar = i8; pub type c_uchar = u8; pub type c_short = i16; diff --git a/src/unix/mod.rs b/src/unix/mod.rs index afb81be3774751f71146a952a62522a44b482ec2..efaad41e84e2071e04001e1b11163cf2c3bfb9bc 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -3,15 +3,6 @@ //! More functions and definitions can be found in the more specific modules //! according to the platform in question. -pub type int8_t = i8; -pub type int16_t = i16; -pub type int32_t = i32; -pub type int64_t = i64; -pub type uint8_t = u8; -pub type uint16_t = u16; -pub type uint32_t = u32; -pub type uint64_t = u64; - pub type c_schar = i8; pub type c_uchar = u8; pub type c_short = i16; diff --git a/src/wasi.rs b/src/wasi.rs index b93486129f046fa838560944ecd7e31049b86265..95a0837d4f9d4c7747aaa30e32475849905c2542 100644 --- a/src/wasi.rs +++ b/src/wasi.rs @@ -19,14 +19,6 @@ pub type intptr_t = isize; pub type uintptr_t = usize; pub type off_t = i64; pub type pid_t = i32; -pub type int8_t = i8; -pub type uint8_t = u8; -pub type int16_t = i16; -pub type uint16_t = u16; -pub type int32_t = i32; -pub type uint32_t = u32; -pub type int64_t = i64; -pub type uint64_t = u64; pub type clock_t = c_longlong; pub type time_t = c_longlong; pub type c_double = f64; diff --git a/src/windows/mod.rs b/src/windows/mod.rs index 70ca675bd6c18bba8cc3b899edd962afa406d5fc..be28b70f5664f65a868fc6d4cd414f3528a8988e 100644 --- a/src/windows/mod.rs +++ b/src/windows/mod.rs @@ -1,14 +1,5 @@ //! Windows CRT definitions -pub type int8_t = i8; -pub type int16_t = i16; -pub type int32_t = i32; -pub type int64_t = i64; -pub type uint8_t = u8; -pub type uint16_t = u16; -pub type uint32_t = u32; -pub type uint64_t = u64; - pub type c_schar = i8; pub type c_uchar = u8; pub type c_short = i16;