Refactor fixed-width integer types into its own module
diff --git a/src/cloudabi/mod.rs b/src/cloudabi/mod.rs
index 8191967..0d86962 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 0000000..9b5a13c
--- /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 2ce2f40..3f4fbaf 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 3e15175..9880b50 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 baf6324..2dc4270 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -90,27 +90,51 @@
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 8a69ad3..7da6269 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 06fa203..801b8ed 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 afb81be..efaad41 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 b934861..95a0837 100644
--- a/src/wasi.rs
+++ b/src/wasi.rs
@@ -19,14 +19,6 @@
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 70ca675..be28b70 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;