Skip to content

Commit 5cd2ec7

Browse files
tgross35AkhilTThomas
authored andcommitted
Gate FreeBSD mcontext_t under libc_align
Enable this backport by just dropping support for FreeBSD mcontext_t without `libc_align`, i.e. with Rust < 1.25 (2018). This is sufficiently niche that it is not worth adding a new `align` module.
1 parent a2cc2da commit 5cd2ec7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1664,6 +1664,7 @@ s_no_extra_traits! {
16641664

16651665
pub struct ucontext_t {
16661666
pub uc_sigmask: ::sigset_t,
1667+
#[cfg(libc_align)]
16671668
pub uc_mcontext: ::mcontext_t,
16681669
pub uc_link: *mut ::ucontext_t,
16691670
pub uc_stack: ::stack_t,
@@ -2601,7 +2602,8 @@ cfg_if! {
26012602
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
26022603
f.debug_struct("ucontext_t")
26032604
.field("uc_sigmask", &self.uc_sigmask)
2604-
.field("uc_mcontext", &self.uc_mcontext)
2605+
// FIXME: enable when libc_align is dropped
2606+
// .field("uc_mcontext", &self.uc_mcontext)
26052607
.field("uc_link", &self.uc_link)
26062608
.field("uc_stack", &self.uc_stack)
26072609
.field("uc_flags", &self.uc_flags)

src/unix/bsd/freebsdlike/freebsd/x86.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ s_no_extra_traits! {
4747
pub(crate) const _ALIGNBYTES: usize = mem::size_of::<c_long>() - 1;
4848

4949
cfg_if! {
50-
if #[cfg(feature = "extra_traits")] {
50+
if #[cfg(all(libc_align, feature = "extra_traits"))] {
5151
impl PartialEq for mcontext_t {
5252
fn eq(&self, other: &mcontext_t) -> bool {
5353
self.mc_onstack == other.mc_onstack

0 commit comments

Comments
 (0)