Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/unix/newlib/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ pub type blksize_t = i32;
pub type clockid_t = c_ulong;

cfg_if! {
if #[cfg(any(target_os = "espidf"))] {
if #[cfg(any(
target_os = "espidf",
target_os = "vita",
target_arch = "aarch64"
))] {
Comment on lines +9 to +13

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For vita, this one seems correct, as by looking at the definitions it seems to be defined as a long. There should also be no change in behavior as both c_int and c_long are aliases to i32 in this platform.

Sources in the top level review comment.

pub type dev_t = c_short;
pub type ino_t = c_ushort;
pub type off_t = c_long;
} else if #[cfg(any(target_os = "vita"))] {
pub type dev_t = c_short;
pub type ino_t = c_ushort;
pub type off_t = c_int;
} else {
pub type dev_t = u32;
pub type ino_t = u32;
Expand Down Expand Up @@ -55,12 +55,12 @@ pub type useconds_t = u32;

cfg_if! {
if #[cfg(any(
target_os = "horizon",
all(target_os = "espidf", not(espidf_time32))
all(target_os = "espidf", espidf_time32),
target_os = "vita"
))] {
pub type time_t = c_longlong;
} else {
pub type time_t = i32;
} else {
pub type time_t = i64;
Comment on lines +62 to +63

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one looks wrong for the vita, which uses 32-bit time, as --enable-newlib-long-time_t is set when building newlib in vitasdk (currently the only supported SDK).

The correct definition would be c_long (effectively i32).

Sources in the top-level comment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. That's fixed now.

}
}

Expand Down