diff options
author | Jeremy Soller <jackpot51@gmail.com> | 2022-12-01 18:03:00 -0700 |
---|---|---|
committer | Jeremy Soller <jackpot51@gmail.com> | 2022-12-01 18:31:59 -0700 |
commit | db3423be55b86c511d1fe6e6e371549f9802a8b6 (patch) | |
tree | 6cd5209c49621a462e80a134b7a27339a6fbb9b7 | |
parent | a90993ec230f58ad92401bbbfb45f4c9da783706 (diff) | |
download | rust-libc-db3423be55b86c511d1fe6e6e371549f9802a8b6.tar.gz |
redox: long is 32-bits on 32-bit systems
-rw-r--r-- | src/unix/redox/mod.rs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs index 3bb7b044d0..6855171990 100644 --- a/src/unix/redox/mod.rs +++ b/src/unix/redox/mod.rs @@ -1,8 +1,20 @@ pub type c_char = i8; -pub type c_long = i64; -pub type c_ulong = u64; pub type wchar_t = i32; +cfg_if! { + if #[cfg(target_pointer_width = "32")] { + pub type c_long = i32; + pub type c_ulong = u32; + } +} + +cfg_if! { + if #[cfg(target_pointer_width = "64")] { + pub type c_long = i64; + pub type c_ulong = u64; + } +} + pub type blkcnt_t = ::c_ulong; pub type blksize_t = ::c_long; pub type clock_t = ::c_long; |