Skip to content

Commit

Permalink
Auto merge of #3024 - redox-os:redox-0.2.137, r=JohnTitor
Browse files Browse the repository at this point in the history
redox: long is 32-bits on 32-bit systems

This ensures that 32-bit systems use i32 for c_long and u32 for c_ulong.

I have also adjusted off_t and time_t to be `long long`, which is what they are in `relibc` now.
  • Loading branch information
bors committed Dec 3, 2022
2 parents 2eea873 + 73a70cb commit 9c311b4
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/unix/redox/mod.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -14,7 +26,7 @@ pub type ino_t = ::c_ulong;
pub type mode_t = ::c_int;
pub type nfds_t = ::c_ulong;
pub type nlink_t = ::c_ulong;
pub type off_t = ::c_long;
pub type off_t = ::c_longlong;
pub type pthread_t = *mut ::c_void;
pub type pthread_attr_t = *mut ::c_void;
pub type pthread_cond_t = *mut ::c_void;
Expand All @@ -34,7 +46,7 @@ pub type socklen_t = u32;
pub type speed_t = u32;
pub type suseconds_t = ::c_int;
pub type tcflag_t = u32;
pub type time_t = ::c_long;
pub type time_t = ::c_longlong;

#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
Expand Down

0 comments on commit 9c311b4

Please sign in to comment.