diff options
author | Linus Färnstrand <faern@faern.net> | 2018-07-17 20:12:59 +0200 |
---|---|---|
committer | Linus Färnstrand <faern@faern.net> | 2018-07-29 18:54:45 +0200 |
commit | 6abe0b52182afc56ac9cb8f09055f80eb4db2bb1 (patch) | |
tree | d4f67b81ba55d40974272c45a748d9014c6f88f5 | |
parent | 7d262c091e9a839304ba23a0615f376917d066fd (diff) | |
download | rust-libc-6abe0b52182afc56ac9cb8f09055f80eb4db2bb1.tar.gz |
Add align feature and use on in6_addr
-rw-r--r-- | Cargo.toml | 1 | ||||
-rw-r--r-- | src/fuchsia/mod.rs | 2 | ||||
-rw-r--r-- | src/redox/net.rs | 2 | ||||
-rw-r--r-- | src/unix/mod.rs | 2 | ||||
-rw-r--r-- | src/unix/uclibc/x86_64/mod.rs | 1 |
5 files changed, 8 insertions, 0 deletions
diff --git a/Cargo.toml b/Cargo.toml index 662d0ad657..c1ff5da233 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,6 +20,7 @@ appveyor = { repository = "rust-lang/libc", project_name = "rust-lang-libs/libc" [features] default = ["use_std"] use_std = [] +align = [] [workspace] members = ["libc-test"] diff --git a/src/fuchsia/mod.rs b/src/fuchsia/mod.rs index 0aac98531a..267b98add9 100644 --- a/src/fuchsia/mod.rs +++ b/src/fuchsia/mod.rs @@ -166,8 +166,10 @@ s! { pub s_addr: in_addr_t, } + #[cfg_attr(feature = "align", repr(align(4)))] pub struct in6_addr { pub s6_addr: [u8; 16], + #[cfg(not(feature = "align"))] __align: [u32; 0], } diff --git a/src/redox/net.rs b/src/redox/net.rs index a545ba4795..fcbb181c32 100644 --- a/src/redox/net.rs +++ b/src/redox/net.rs @@ -9,8 +9,10 @@ s! { pub s_addr: in_addr_t, } + #[cfg_attr(feature = "align", repr(align(4)))] pub struct in6_addr { pub s6_addr: [u8; 16], + #[cfg(not(feature = "align"))] __align: [u32; 0], } diff --git a/src/unix/mod.rs b/src/unix/mod.rs index 89cc1e3348..d0e054cc27 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -104,8 +104,10 @@ s! { pub s_addr: in_addr_t, } + #[cfg_attr(feature = "align", repr(align(4)))] pub struct in6_addr { pub s6_addr: [u8; 16], + #[cfg(not(feature = "align"))] __align: [u32; 0], } diff --git a/src/unix/uclibc/x86_64/mod.rs b/src/unix/uclibc/x86_64/mod.rs index bfd46447fd..a8d5854348 100644 --- a/src/unix/uclibc/x86_64/mod.rs +++ b/src/unix/uclibc/x86_64/mod.rs @@ -133,6 +133,7 @@ s! { // // pub struct in6_addr { // pub s6_addr: [u8; 16], +// #[cfg(not(feature = "align"))] // __align: [u32; 0], // } |