Skip to content

Commit

Permalink
Use #[repr(align(32))] instead of private field for in6_addr.
Browse files Browse the repository at this point in the history
This allows constructiong in6_addr instances as a constant from other
crates.

See rust-lang/rust#44582 (comment)
  • Loading branch information
tmccombs committed Apr 5, 2018
1 parent 829d020 commit cf3fd38
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/fuchsia/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ s! {
pub s_addr: in_addr_t,
}

#[repr(align(32))]
pub struct in6_addr {
pub s6_addr: [u8; 16],
__align: [u32; 0],
pub s6_addr: [u8; 16]
}

pub struct ip_mreq {
Expand Down
4 changes: 2 additions & 2 deletions src/redox/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ s! {
pub s_addr: in_addr_t,
}

#[repr(align(32))]
pub struct in6_addr {
pub s6_addr: [u8; 16],
__align: [u32; 0],
pub s6_addr: [u8; 16]
}

pub struct ip_mreq {
Expand Down
4 changes: 2 additions & 2 deletions src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ s! {
pub s_addr: in_addr_t,
}

#[repr(align(32))]
pub struct in6_addr {
pub s6_addr: [u8; 16],
__align: [u32; 0],
pub s6_addr: [u8; 16]
}

pub struct ip_mreq {
Expand Down

0 comments on commit cf3fd38

Please sign in to comment.