Add align feature to sem_t struct

This commit is contained in:
Linus Färnstrand 2018-07-26 20:56:56 +02:00
parent 5f38367da3
commit 41ca29f709
6 changed files with 30 additions and 0 deletions

View File

@ -21,11 +21,16 @@ s! {
}
// FIXME this is actually a union
#[cfg_attr(all(feature = "align", target_pointer_width = "32"),
repr(align(4)))]
#[cfg_attr(all(feature = "align", target_pointer_width = "64"),
repr(align(8)))]
pub struct sem_t {
#[cfg(target_pointer_width = "32")]
__size: [::c_char; 16],
#[cfg(target_pointer_width = "64")]
__size: [::c_char; 32],
#[cfg(not(feature = "align"))]
__align: [::c_long; 0],
}

View File

@ -158,11 +158,16 @@ s! {
}
// FIXME this is actually a union
#[cfg_attr(all(feature = "align", target_pointer_width = "32"),
repr(align(4)))]
#[cfg_attr(all(feature = "align", target_pointer_width = "64"),
repr(align(8)))]
pub struct sem_t {
#[cfg(target_pointer_width = "32")]
__size: [::c_char; 16],
#[cfg(target_pointer_width = "64")]
__size: [::c_char; 32],
#[cfg(not(feature = "align"))]
__align: [::c_long; 0],
}

View File

@ -245,8 +245,13 @@ s! {
}
// FIXME this is actually a union
#[cfg_attr(all(feature = "align", target_pointer_width = "32"),
repr(align(4)))]
#[cfg_attr(all(feature = "align", target_pointer_width = "64"),
repr(align(8)))]
pub struct sem_t {
__size: [::c_char; 32],
#[cfg(not(feature = "align"))]
__align: [::c_long; 0],
}

View File

@ -222,11 +222,16 @@ s! {
}
// FIXME this is actually a union
#[cfg_attr(all(feature = "align", target_pointer_width = "32"),
repr(align(4)))]
#[cfg_attr(all(feature = "align", target_pointer_width = "64"),
repr(align(8)))]
pub struct sem_t {
#[cfg(target_pointer_width = "32")]
__size: [::c_char; 16],
#[cfg(target_pointer_width = "64")]
__size: [::c_char; 32],
#[cfg(not(feature = "align"))]
__align: [::c_long; 0],
}
}

View File

@ -188,8 +188,13 @@ s! {
}
// FIXME this is actually a union
#[cfg_attr(all(feature = "align", target_pointer_width = "32"),
repr(align(4)))]
#[cfg_attr(all(feature = "align", target_pointer_width = "64"),
repr(align(8)))]
pub struct sem_t {
__size: [::c_char; 32],
#[cfg(not(feature = "align"))]
__align: [::c_long; 0],
}
}

View File

@ -205,11 +205,16 @@ s! {
pub c_cc: [::cc_t; ::NCCS],
}
#[cfg_attr(all(feature = "align", target_pointer_width = "32"),
repr(align(4)))]
#[cfg_attr(all(feature = "align", target_pointer_width = "64"),
repr(align(8)))]
pub struct sem_t { // ToDo
#[cfg(target_pointer_width = "32")]
__size: [::c_char; 16],
#[cfg(target_pointer_width = "64")]
__size: [::c_char; 32],
#[cfg(not(feature = "align"))]
__align: [::c_long; 0],
}