-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Added all definitions from linux/ptp-clock.h #3353
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @JohnTitor (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
pub union __c_anonymous_ptp_perout_request_1 { | ||
pub start: ptp_clock_time, | ||
pub phase: ptp_clock_time, | ||
} | ||
|
||
#[cfg(libc_union)] | ||
pub union __c_anonymous_ptp_perout_request_2 { | ||
pub on: ptp_clock_time, | ||
pub rsv: [::c_uint; 4], | ||
} |
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.
based on
#[cfg(libc_union)]
pub union __c_anonymous_ifr_ifru {
pub ifru_addr: ::sockaddr,
pub ifru_dstaddr: ::sockaddr,
these need that #[cfg(libc_union)]
pragma. Then at the use site they need a "default" (highest size and alignment of the variants, I guess)
pub struct ifreq {
/// interface name, e.g. "en0"
pub ifr_name: [::c_char; ::IFNAMSIZ],
#[cfg(libc_union)]
pub ifr_ifru: __c_anonymous_ifr_ifru,
#[cfg(not(libc_union))]
pub ifr_ifru: ::sockaddr,
}
☔ The latest upstream changes (presumably #3376) made this pull request unmergeable. Please resolve the merge conflicts. |
Could you resolve the merge conflict and CI failure? Thanks! |
@JohnTitor I would love to, but I don't know how to fix the CI. Essentially, it is failing because the ptp_perout_request struct contains unnamed anonymous enums (so both the enum and the field that is of the type of the enum don't have a name), and I don't know how to tell the CI that properly. |
You can check around: Lines 3480 to 3520 in d0ce87b
|
Lines 4180 to 4184 in 3195caf
add this
|
Replaced by #3559 |
This still has some trouble passing CI due to two unnamed anonymous unions in ptp_perout_request. Any guidance on how to deal with those in a better way?