-
Notifications
You must be signed in to change notification settings - Fork 1.3k
newlib: fix definition of time_t and off_t
#5132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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" | ||||||
| ))] { | ||||||
| pub type dev_t = u32; | ||||||
| pub type ino_t = u32; | ||||||
| pub type off_t = i64; | ||||||
| } else { | ||||||
| std::compile_error! { "unsupported target" } | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Needs to work with no-std, and syntax nit |
||||||
| } | ||||||
| } | ||||||
|
|
||||||
|
|
@@ -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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 The correct definition would be Sources in the top-level comment.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. That's fixed now. |
||||||
| } | ||||||
| } | ||||||
|
|
||||||
|
|
@@ -937,6 +940,8 @@ extern "C" { | |||||
|
|
||||||
| mod generic; | ||||||
|
|
||||||
| pub use self::generic::*; | ||||||
|
|
||||||
| cfg_if! { | ||||||
| if #[cfg(target_os = "espidf")] { | ||||||
| mod espidf; | ||||||
|
|
@@ -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::*; | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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