Skip to content
Open
Show file tree
Hide file tree
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
56 changes: 0 additions & 56 deletions src/unix/newlib/aarch64/mod.rs

This file was deleted.

28 changes: 15 additions & 13 deletions src/unix/newlib/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,21 @@ 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"))] {
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 {
} else if #[cfg(any(
target_os = "rtems",
target_os = "horizon",
target_os = "arm",
target_os = "powerpc"
Comment on lines +16 to +17

@tgross35 tgross35 Jul 4, 2026

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.

These have target_os, but I don't think we need arch-based config anyway?

View changes since the review

))] {
pub type dev_t = u32;
pub type ino_t = u32;
pub type off_t = i64;
} else {
std::compile_error! { "unsupported target" }

@tgross35 tgross35 Jul 4, 2026

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.

Suggested change
std::compile_error! { "unsupported target" }
core::compile_error!("unsupported target");

Needs to work with no-std, and syntax nit

View changes since the review

}
}

Expand Down Expand Up @@ -55,12 +58,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;
pub type time_t = c_long;
} else {
pub type time_t = i32;
pub type time_t = i64;
Comment on lines +65 to +66

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 Expand Up @@ -937,6 +940,8 @@ extern "C" {

mod generic;

pub use self::generic::*;

cfg_if! {
if #[cfg(target_os = "espidf")] {
mod espidf;
Expand All @@ -950,9 +955,6 @@ cfg_if! {
} else if #[cfg(target_arch = "arm")] {
mod arm;
pub use self::arm::*;
} else if #[cfg(target_arch = "aarch64")] {
mod aarch64;
pub use self::aarch64::*;
} else if #[cfg(target_arch = "powerpc")] {
mod powerpc;
pub use self::powerpc::*;
Expand Down
Loading