Add align feature to pthread structs
diff --git a/src/fuchsia/mod.rs b/src/fuchsia/mod.rs
index 267b98a..e103292 100644
--- a/src/fuchsia/mod.rs
+++ b/src/fuchsia/mod.rs
@@ -520,14 +520,30 @@
pub ifa_data: *mut ::c_void
}
+ #[cfg_attr(all(feature = "align",
+ target_pointer_width = "32",
+ any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc",
+ target_arch = "x86_64")),
+ repr(align(4)))]
+ #[cfg_attr(all(feature = "align",
+ any(target_pointer_width = "64",
+ not(any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc",
+ target_arch = "x86_64")))),
+ repr(align(8)))]
pub struct pthread_mutex_t {
- #[cfg(any(target_arch = "mips",
- target_arch = "arm",
- target_arch = "powerpc",
- all(target_arch = "x86_64",
- target_pointer_width = "32")))]
+ #[cfg(all(not(feature = "align"),
+ any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc",
+ all(target_arch = "x86_64",
+ target_pointer_width = "32"))))]
__align: [::c_long; 0],
- #[cfg(not(any(target_arch = "mips",
+ #[cfg(not(any(feature = "align",
+ target_arch = "mips",
target_arch = "arm",
target_arch = "powerpc",
all(target_arch = "x86_64",
@@ -536,14 +552,30 @@
size: [u8; __SIZEOF_PTHREAD_MUTEX_T],
}
+ #[cfg_attr(all(feature = "align",
+ target_pointer_width = "32",
+ any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc",
+ target_arch = "x86_64")),
+ repr(align(4)))]
+ #[cfg_attr(all(feature = "align",
+ any(target_pointer_width = "64",
+ not(any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc",
+ target_arch = "x86_64")))),
+ repr(align(8)))]
pub struct pthread_rwlock_t {
- #[cfg(any(target_arch = "mips",
- target_arch = "arm",
- target_arch = "powerpc",
- all(target_arch = "x86_64",
- target_pointer_width = "32")))]
+ #[cfg(all(not(feature = "align"),
+ any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc",
+ all(target_arch = "x86_64",
+ target_pointer_width = "32"))))]
__align: [::c_long; 0],
- #[cfg(not(any(target_arch = "mips",
+ #[cfg(not(any(feature = "align",
+ target_arch = "mips",
target_arch = "arm",
target_arch = "powerpc",
all(target_arch = "x86_64",
@@ -552,39 +584,78 @@
size: [u8; __SIZEOF_PTHREAD_RWLOCK_T],
}
+ #[cfg_attr(all(feature = "align",
+ any(target_pointer_width = "32",
+ target_arch = "x86_64", target_arch = "powerpc64",
+ target_arch = "mips64", target_arch = "s390x",
+ target_arch = "sparc64",
+ all(target_arch = "aarch64", target_env = "musl"))),
+ repr(align(4)))]
+ #[cfg_attr(all(feature = "align",
+ not(any(target_pointer_width = "32",
+ target_arch = "x86_64", target_arch = "powerpc64",
+ target_arch = "mips64", target_arch = "s390x",
+ target_arch = "sparc64",
+ all(target_arch = "aarch64", target_env = "musl")))),
+ repr(align(8)))]
pub struct pthread_mutexattr_t {
- #[cfg(any(target_arch = "x86_64", target_arch = "powerpc64",
- target_arch = "mips64", target_arch = "s390x",
- target_arch = "sparc64"))]
- __align: [::c_int; 0],
- #[cfg(not(any(target_arch = "x86_64", target_arch = "powerpc64",
+ #[cfg(all(not(features = "align"),
+ any(target_arch = "x86_64", target_arch = "powerpc64",
target_arch = "mips64", target_arch = "s390x",
- target_arch = "sparc64", target_arch = "aarch64")))]
- __align: [::c_long; 0],
- #[cfg(all(target_arch = "aarch64", target_env = "gnu"))]
- __align: [::c_long; 0],
- #[cfg(all(target_arch = "aarch64", target_env = "musl"))]
+ target_arch = "sparc64",
+ all(target_arch = "aarch64", target_env = "musl"))))]
__align: [::c_int; 0],
+ #[cfg(all(not(features = "align"),
+ not(any(target_arch = "x86_64", target_arch = "powerpc64",
+ target_arch = "mips64", target_arch = "s390x",
+ target_arch = "sparc64",
+ all(target_arch = "aarch64", target_env = "musl")))))]
+ __align: [::c_long; 0],
size: [u8; __SIZEOF_PTHREAD_MUTEXATTR_T],
}
+ #[cfg_attr(all(feature = "align",
+ any(target_env = "musl", target_pointer_width = "32")),
+ repr(align(4)))]
+ #[cfg_attr(all(feature = "align",
+ not(target_env = "musl"),
+ target_pointer_width = "64"),
+ repr(align(8)))]
pub struct pthread_rwlockattr_t {
- #[cfg(any(target_env = "musl"))]
+ #[cfg(all(not(feature = "align"), target_env = "musl"))]
__align: [::c_int; 0],
- #[cfg(not(any(target_env = "musl")))]
+ #[cfg(all(not(feature = "align"), not(target_env = "musl")))]
__align: [::c_long; 0],
size: [u8; __SIZEOF_PTHREAD_RWLOCKATTR_T],
}
+ #[cfg_attr(all(feature = "align",
+ target_env = "musl",
+ target_pointer_width = "32"),
+ repr(align(4)))]
+ #[cfg_attr(all(feature = "align",
+ target_env = "musl",
+ target_pointer_width = "64"),
+ repr(align(8)))]
+ #[cfg_attr(all(feature = "align",
+ not(target_env = "musl"),
+ target_arch = "x86"),
+ repr(align(4)))]
+ #[cfg_attr(all(feature = "align",
+ not(target_env = "musl"),
+ not(target_arch = "x86")),
+ repr(align(8)))]
pub struct pthread_cond_t {
- #[cfg(any(target_env = "musl"))]
+ #[cfg(all(not(feature = "align"), target_env = "musl"))]
__align: [*const ::c_void; 0],
- #[cfg(not(any(target_env = "musl")))]
+ #[cfg(not(any(feature = "align", target_env = "musl")))]
__align: [::c_longlong; 0],
size: [u8; __SIZEOF_PTHREAD_COND_T],
}
+ #[cfg_attr(feature = "align", repr(align(4)))]
pub struct pthread_condattr_t {
+ #[cfg(not(feature = "align"))]
__align: [::c_int; 0],
size: [u8; __SIZEOF_PTHREAD_CONDATTR_T],
}
@@ -2006,18 +2077,17 @@
pub const TCP_MD5SIG: ::c_int = 14;
-pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
- __align: [],
- size: [0; __SIZEOF_PTHREAD_MUTEX_T],
-};
-pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
- __align: [],
- size: [0; __SIZEOF_PTHREAD_COND_T],
-};
-pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
- __align: [],
- size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
-};
+align_const! {
+ pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
+ size: [0; __SIZEOF_PTHREAD_MUTEX_T],
+ };
+ pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
+ size: [0; __SIZEOF_PTHREAD_COND_T],
+ };
+ pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
+ size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
+ };
+}
pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
diff --git a/src/macros.rs b/src/macros.rs
index 2abab50..f48ad45 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -69,3 +69,20 @@
macro_rules! __item {
($i:item) => ($i)
}
+
+#[allow(unused_macros)]
+macro_rules! align_const {
+ ($($(#[$attr:meta])* pub const $name:ident : $t1:ty = $t2:ident { $($field:tt)* };)*) => ($(
+ #[cfg(feature = "align")]
+ $(#[$attr])*
+ pub const $name : $t1 = $t2 {
+ $($field)*
+ };
+ #[cfg(not(feature = "align"))]
+ $(#[$attr])*
+ pub const $name : $t1 = $t2 {
+ $($field)*
+ __align: [],
+ };
+ )*)
+}
diff --git a/src/unix/newlib/mod.rs b/src/unix/newlib/mod.rs
index 6cf8633..9968d36 100644
--- a/src/unix/newlib/mod.rs
+++ b/src/unix/newlib/mod.rs
@@ -238,34 +238,80 @@
__size: [u64; 7]
}
+ #[cfg_attr(all(feature = "align",
+ target_pointer_width = "32",
+ any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc")),
+ repr(align(4)))]
+ #[cfg_attr(all(feature = "align",
+ any(target_pointer_width = "64",
+ not(any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc")))),
+ repr(align(8)))]
pub struct pthread_mutex_t { // Unverified
- #[cfg(any(target_arch = "mips", target_arch = "arm",
- target_arch = "powerpc"))]
+ #[cfg(all(not(feature = "align"),
+ any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc")))]
__align: [::c_long; 0],
- #[cfg(not(any(target_arch = "mips", target_arch = "arm",
+ #[cfg(not(any(feature = "align",
+ target_arch = "mips",
+ target_arch = "arm",
target_arch = "powerpc")))]
__align: [::c_longlong; 0],
size: [u8; __SIZEOF_PTHREAD_MUTEX_T],
}
+ #[cfg_attr(all(feature = "align",
+ target_pointer_width = "32",
+ any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc")),
+ repr(align(4)))]
+ #[cfg_attr(all(feature = "align",
+ any(target_pointer_width = "64",
+ not(any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc")))),
+ repr(align(8)))]
pub struct pthread_rwlock_t { // Unverified
- #[cfg(any(target_arch = "mips", target_arch = "arm",
- target_arch = "powerpc"))]
+ #[cfg(all(not(feature = "align"),
+ any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc")))]
__align: [::c_long; 0],
- #[cfg(not(any(target_arch = "mips", target_arch = "arm",
+ #[cfg(not(any(feature = "align",
+ target_arch = "mips",
+ target_arch = "arm",
target_arch = "powerpc")))]
__align: [::c_longlong; 0],
size: [u8; __SIZEOF_PTHREAD_RWLOCK_T],
}
+ #[cfg_attr(all(feature = "align",
+ any(target_pointer_width = "32",
+ target_arch = "x86_64", target_arch = "powerpc64",
+ target_arch = "mips64", target_arch = "s390x",
+ target_arch = "sparc64")),
+ repr(align(4)))]
+ #[cfg_attr(all(feature = "align",
+ not(any(target_pointer_width = "32",
+ target_arch = "x86_64", target_arch = "powerpc64",
+ target_arch = "mips64", target_arch = "s390x",
+ target_arch = "sparc64"))),
+ repr(align(8)))]
pub struct pthread_mutexattr_t { // Unverified
- #[cfg(any(target_arch = "x86_64", target_arch = "powerpc64",
- target_arch = "mips64", target_arch = "s390x",
- target_arch = "sparc64"))]
- __align: [::c_int; 0],
- #[cfg(not(any(target_arch = "x86_64", target_arch = "powerpc64",
+ #[cfg(all(not(feature = "align"),
+ any(target_arch = "x86_64", target_arch = "powerpc64",
target_arch = "mips64", target_arch = "s390x",
target_arch = "sparc64")))]
+ __align: [::c_int; 0],
+ #[cfg(all(not(feature = "align"),
+ not(any(target_arch = "x86_64", target_arch = "powerpc64",
+ target_arch = "mips64", target_arch = "s390x",
+ target_arch = "sparc64"))))]
__align: [::c_long; 0],
size: [u8; __SIZEOF_PTHREAD_MUTEXATTR_T],
}
@@ -275,12 +321,16 @@
__pshared: ::c_int,
}
+ #[cfg_attr(feature = "align", repr(align(8)))]
pub struct pthread_cond_t { // Unverified
+ #[cfg(not(feature = "align"))]
__align: [::c_longlong; 0],
size: [u8; __SIZEOF_PTHREAD_COND_T],
}
+ #[cfg_attr(feature = "align", repr(align(4)))]
pub struct pthread_condattr_t { // Unverified
+ #[cfg(not(feature = "align"))]
__align: [::c_int; 0],
size: [u8; __SIZEOF_PTHREAD_CONDATTR_T],
}
@@ -288,18 +338,17 @@
}
// unverified constants
-pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
- __align: [],
- size: [0; __SIZEOF_PTHREAD_MUTEX_T],
-};
-pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
- __align: [],
- size: [0; __SIZEOF_PTHREAD_COND_T],
-};
-pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
- __align: [],
- size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
-};
+align_const! {
+ pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
+ size: [0; __SIZEOF_PTHREAD_MUTEX_T],
+ };
+ pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
+ size: [0; __SIZEOF_PTHREAD_COND_T],
+ };
+ pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
+ size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
+ };
+}
pub const NCCS: usize = 32;
pub const __SIZEOF_PTHREAD_ATTR_T: usize = 56;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
diff --git a/src/unix/notbsd/emscripten.rs b/src/unix/notbsd/emscripten.rs
index 6216947..b30fee3 100644
--- a/src/unix/notbsd/emscripten.rs
+++ b/src/unix/notbsd/emscripten.rs
@@ -72,32 +72,47 @@
__unused5: *mut ::c_void,
}
+ #[cfg_attr(feature = "align", repr(align(4)))]
pub struct pthread_mutex_t {
+ #[cfg(not(feature = "align"))]
__align: [::c_long; 0],
size: [u8; __SIZEOF_PTHREAD_MUTEX_T],
}
+ #[cfg_attr(feature = "align", repr(align(4)))]
pub struct pthread_rwlock_t {
+ #[cfg(not(feature = "align"))]
__align: [::c_long; 0],
size: [u8; __SIZEOF_PTHREAD_RWLOCK_T],
}
+ #[cfg_attr(feature = "align", repr(align(4)))]
pub struct pthread_mutexattr_t {
+ #[cfg(not(feature = "align"))]
__align: [::c_int; 0],
size: [u8; __SIZEOF_PTHREAD_MUTEXATTR_T],
}
+ #[cfg_attr(feature = "align", repr(align(4)))]
pub struct pthread_rwlockattr_t {
+ #[cfg(not(feature = "align"))]
__align: [::c_int; 0],
size: [u8; __SIZEOF_PTHREAD_RWLOCKATTR_T],
}
+ #[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 pthread_cond_t {
+ #[cfg(not(feature = "align"))]
__align: [*const ::c_void; 0],
size: [u8; __SIZEOF_PTHREAD_COND_T],
}
+ #[cfg_attr(feature = "align", repr(align(4)))]
pub struct pthread_condattr_t {
+ #[cfg(not(feature = "align"))]
__align: [::c_int; 0],
size: [u8; __SIZEOF_PTHREAD_CONDATTR_T],
}
@@ -747,18 +762,18 @@
pub const TCP_MD5SIG: ::c_int = 14;
-pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
- __align: [],
- size: [0; __SIZEOF_PTHREAD_MUTEX_T],
-};
-pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
- __align: [],
- size: [0; __SIZEOF_PTHREAD_COND_T],
-};
-pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
- __align: [],
- size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
-};
+align_const! {
+ pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
+ size: [0; __SIZEOF_PTHREAD_MUTEX_T],
+ };
+ pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
+ size: [0; __SIZEOF_PTHREAD_COND_T],
+ };
+ pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
+ size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
+ };
+}
+
pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
diff --git a/src/unix/notbsd/linux/mips/mips32.rs b/src/unix/notbsd/linux/mips/mips32.rs
index d9d5035..a6c08a5 100644
--- a/src/unix/notbsd/linux/mips/mips32.rs
+++ b/src/unix/notbsd/linux/mips/mips32.rs
@@ -1,3 +1,5 @@
+use pthread_mutex_t;
+
pub type c_char = i8;
pub type c_long = i32;
pub type c_ulong = u32;
@@ -278,60 +280,56 @@
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
-#[cfg(target_endian = "little")]
-pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,
- ],
- };
-#[cfg(target_endian = "little")]
-pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,
- ],
- };
-#[cfg(target_endian = "little")]
-pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,
- ],
- };
-#[cfg(target_endian = "big")]
-pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0,
- ],
- };
-#[cfg(target_endian = "big")]
-pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0,
- 0, 0,
- ],
- };
-#[cfg(target_endian = "big")]
-pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0,
- 0, 0,
- ],
- };
+align_const! {
+ #[cfg(target_endian = "little")]
+ pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "little")]
+ pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "little")]
+ pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "big")]
+ pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "big")]
+ pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0,
+ 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "big")]
+ pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0,
+ ],
+ };
+}
pub const O_LARGEFILE: ::c_int = 0x2000;
diff --git a/src/unix/notbsd/linux/mips/mips64.rs b/src/unix/notbsd/linux/mips/mips64.rs
index 747b97b..e8b02a3 100644
--- a/src/unix/notbsd/linux/mips/mips64.rs
+++ b/src/unix/notbsd/linux/mips/mips64.rs
@@ -1,3 +1,5 @@
+use pthread_mutex_t;
+
pub type blkcnt_t = i64;
pub type blksize_t = i64;
pub type c_char = i8;
@@ -262,60 +264,56 @@
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
-#[cfg(target_endian = "little")]
-pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
-#[cfg(target_endian = "little")]
-pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
-#[cfg(target_endian = "little")]
-pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
-#[cfg(target_endian = "big")]
-pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
-#[cfg(target_endian = "big")]
-pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
-#[cfg(target_endian = "big")]
-pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
+align_const! {
+ #[cfg(target_endian = "little")]
+ pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "little")]
+ pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "little")]
+ pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "big")]
+ pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "big")]
+ pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "big")]
+ pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+}
pub const O_LARGEFILE: ::c_int = 0;
diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs
index e1e3503..6bc7db1 100644
--- a/src/unix/notbsd/linux/mod.rs
+++ b/src/unix/notbsd/linux/mod.rs
@@ -71,14 +71,32 @@
__unused5: *mut ::c_void,
}
+ #[cfg_attr(all(feature = "align",
+ target_pointer_width = "32",
+ any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc",
+ target_arch = "x86_64",
+ target_arch = "x86")),
+ repr(align(4)))]
+ #[cfg_attr(all(feature = "align",
+ any(target_pointer_width = "64",
+ not(any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc",
+ target_arch = "x86_64",
+ target_arch = "x86")))),
+ repr(align(8)))]
pub struct pthread_mutex_t {
- #[cfg(any(target_arch = "mips",
- target_arch = "arm",
- target_arch = "powerpc",
- all(target_arch = "x86_64",
- target_pointer_width = "32")))]
+ #[cfg(all(not(feature = "align"),
+ any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc",
+ all(target_arch = "x86_64",
+ target_pointer_width = "32"))))]
__align: [::c_long; 0],
- #[cfg(not(any(target_arch = "mips",
+ #[cfg(not(any(feature = "align",
+ target_arch = "mips",
target_arch = "arm",
target_arch = "powerpc",
all(target_arch = "x86_64",
@@ -87,14 +105,32 @@
size: [u8; __SIZEOF_PTHREAD_MUTEX_T],
}
+ #[cfg_attr(all(feature = "align",
+ target_pointer_width = "32",
+ any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc",
+ target_arch = "x86_64",
+ target_arch = "x86")),
+ repr(align(4)))]
+ #[cfg_attr(all(feature = "align",
+ any(target_pointer_width = "64",
+ not(any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc",
+ target_arch = "x86_64",
+ target_arch = "x86")))),
+ repr(align(8)))]
pub struct pthread_rwlock_t {
- #[cfg(any(target_arch = "mips",
- target_arch = "arm",
- target_arch = "powerpc",
- all(target_arch = "x86_64",
- target_pointer_width = "32")))]
+ #[cfg(all(not(feature = "align"),
+ any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc",
+ all(target_arch = "x86_64",
+ target_pointer_width = "32"))))]
__align: [::c_long; 0],
- #[cfg(not(any(target_arch = "mips",
+ #[cfg(not(any(feature = "align",
+ target_arch = "mips",
target_arch = "arm",
target_arch = "powerpc",
all(target_arch = "x86_64",
@@ -103,39 +139,78 @@
size: [u8; __SIZEOF_PTHREAD_RWLOCK_T],
}
+ #[cfg_attr(all(feature = "align",
+ any(target_pointer_width = "32",
+ target_arch = "x86_64", target_arch = "powerpc64",
+ target_arch = "mips64", target_arch = "s390x",
+ target_arch = "sparc64",
+ all(target_arch = "aarch64", target_env = "musl"))),
+ repr(align(4)))]
+ #[cfg_attr(all(feature = "align",
+ not(any(target_pointer_width = "32",
+ target_arch = "x86_64", target_arch = "powerpc64",
+ target_arch = "mips64", target_arch = "s390x",
+ target_arch = "sparc64",
+ all(target_arch = "aarch64", target_env = "musl")))),
+ repr(align(8)))]
pub struct pthread_mutexattr_t {
- #[cfg(any(target_arch = "x86_64", target_arch = "powerpc64",
- target_arch = "mips64", target_arch = "s390x",
- target_arch = "sparc64"))]
- __align: [::c_int; 0],
- #[cfg(not(any(target_arch = "x86_64", target_arch = "powerpc64",
+ #[cfg(all(not(features = "align"),
+ any(target_arch = "x86_64", target_arch = "powerpc64",
target_arch = "mips64", target_arch = "s390x",
- target_arch = "sparc64", target_arch = "aarch64")))]
- __align: [::c_long; 0],
- #[cfg(all(target_arch = "aarch64", target_env = "gnu"))]
- __align: [::c_long; 0],
- #[cfg(all(target_arch = "aarch64", target_env = "musl"))]
+ target_arch = "sparc64",
+ all(target_arch = "aarch64", target_env = "musl"))))]
__align: [::c_int; 0],
+ #[cfg(all(not(features = "align"),
+ not(any(target_arch = "x86_64", target_arch = "powerpc64",
+ target_arch = "mips64", target_arch = "s390x",
+ target_arch = "sparc64",
+ all(target_arch = "aarch64", target_env = "musl")))))]
+ __align: [::c_long; 0],
size: [u8; __SIZEOF_PTHREAD_MUTEXATTR_T],
}
+ #[cfg_attr(all(feature = "align",
+ any(target_env = "musl", target_pointer_width = "32")),
+ repr(align(4)))]
+ #[cfg_attr(all(feature = "align",
+ not(target_env = "musl"),
+ target_pointer_width = "64"),
+ repr(align(8)))]
pub struct pthread_rwlockattr_t {
- #[cfg(any(target_env = "musl"))]
+ #[cfg(all(not(feature = "align"), target_env = "musl"))]
__align: [::c_int; 0],
- #[cfg(not(any(target_env = "musl")))]
+ #[cfg(all(not(feature = "align"), not(target_env = "musl")))]
__align: [::c_long; 0],
size: [u8; __SIZEOF_PTHREAD_RWLOCKATTR_T],
}
+ #[cfg_attr(all(feature = "align",
+ target_env = "musl",
+ target_pointer_width = "32"),
+ repr(align(4)))]
+ #[cfg_attr(all(feature = "align",
+ target_env = "musl",
+ target_pointer_width = "64"),
+ repr(align(8)))]
+ #[cfg_attr(all(feature = "align",
+ not(target_env = "musl"),
+ target_arch = "x86"),
+ repr(align(4)))]
+ #[cfg_attr(all(feature = "align",
+ not(target_env = "musl"),
+ not(target_arch = "x86")),
+ repr(align(8)))]
pub struct pthread_cond_t {
- #[cfg(any(target_env = "musl"))]
+ #[cfg(all(not(feature = "align"), target_env = "musl"))]
__align: [*const ::c_void; 0],
- #[cfg(not(any(target_env = "musl")))]
+ #[cfg(not(any(feature = "align", target_env = "musl")))]
__align: [::c_longlong; 0],
size: [u8; __SIZEOF_PTHREAD_COND_T],
}
+ #[cfg_attr(feature = "align", repr(align(4)))]
pub struct pthread_condattr_t {
+ #[cfg(not(feature = "align"))]
__align: [::c_int; 0],
size: [u8; __SIZEOF_PTHREAD_CONDATTR_T],
}
@@ -792,18 +867,17 @@
pub const TCP_MD5SIG: ::c_int = 14;
-pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
- __align: [],
- size: [0; __SIZEOF_PTHREAD_MUTEX_T],
-};
-pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
- __align: [],
- size: [0; __SIZEOF_PTHREAD_COND_T],
-};
-pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
- __align: [],
- size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
-};
+align_const! {
+ pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
+ size: [0; __SIZEOF_PTHREAD_MUTEX_T],
+ };
+ pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
+ size: [0; __SIZEOF_PTHREAD_COND_T],
+ };
+ pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
+ size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
+ };
+}
pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
diff --git a/src/unix/notbsd/linux/other/b32/mod.rs b/src/unix/notbsd/linux/other/b32/mod.rs
index 88a5d6c..5b0142a 100644
--- a/src/unix/notbsd/linux/other/b32/mod.rs
+++ b/src/unix/notbsd/linux/other/b32/mod.rs
@@ -1,5 +1,7 @@
//! 32-bit specific definitions for linux-like values
+use pthread_mutex_t;
+
pub type c_long = i32;
pub type c_ulong = u32;
pub type clock_t = i32;
@@ -299,60 +301,56 @@
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
-#[cfg(target_endian = "little")]
-pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,
- ],
- };
-#[cfg(target_endian = "little")]
-pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,
- ],
- };
-#[cfg(target_endian = "little")]
-pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0,
- ],
- };
-#[cfg(target_endian = "big")]
-pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
- 0, 0,
- ],
- };
-#[cfg(target_endian = "big")]
-pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0,
- 0, 0,
- ],
- };
-#[cfg(target_endian = "big")]
-pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0,
- 0, 0,
- ],
- };
+align_const! {
+ #[cfg(target_endian = "little")]
+ pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "little")]
+ pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "little")]
+ pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "big")]
+ pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "big")]
+ pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0,
+ 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "big")]
+ pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0,
+ ],
+ };
+}
pub const PTRACE_GETFPREGS: ::c_uint = 14;
pub const PTRACE_SETFPREGS: ::c_uint = 15;
diff --git a/src/unix/notbsd/linux/other/b64/aarch64.rs b/src/unix/notbsd/linux/other/b64/aarch64.rs
index cfa8592..2ba27a7 100644
--- a/src/unix/notbsd/linux/other/b64/aarch64.rs
+++ b/src/unix/notbsd/linux/other/b64/aarch64.rs
@@ -1,5 +1,7 @@
//! AArch64-specific definitions for 64-bit linux-like values
+use pthread_mutex_t;
+
pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = u8;
@@ -386,33 +388,32 @@
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 48;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 8;
-pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,
- ],
- };
-pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,
- ],
- };
-pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,
- ],
- };
+align_const! {
+ pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ ],
+ };
+}
pub const O_DIRECT: ::c_int = 0x10000;
pub const O_DIRECTORY: ::c_int = 0x4000;
diff --git a/src/unix/notbsd/linux/other/b64/not_x32.rs b/src/unix/notbsd/linux/other/b64/not_x32.rs
index 7f42125..e3e4498 100644
--- a/src/unix/notbsd/linux/other/b64/not_x32.rs
+++ b/src/unix/notbsd/linux/other/b64/not_x32.rs
@@ -1,3 +1,5 @@
+use pthread_mutex_t;
+
pub type c_long = i64;
pub type c_ulong = u64;
@@ -21,60 +23,56 @@
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
-#[cfg(target_endian = "little")]
-pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
-#[cfg(target_endian = "little")]
-pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
-#[cfg(target_endian = "little")]
-pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
-#[cfg(target_endian = "big")]
-pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
-#[cfg(target_endian = "big")]
-pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
-#[cfg(target_endian = "big")]
-pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
+align_const! {
+ #[cfg(target_endian = "little")]
+ pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "little")]
+ pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "little")]
+ pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "big")]
+ pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "big")]
+ pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "big")]
+ pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+}
// Syscall table
diff --git a/src/unix/notbsd/linux/other/b64/powerpc64.rs b/src/unix/notbsd/linux/other/b64/powerpc64.rs
index 858aa24..9dd91f0 100644
--- a/src/unix/notbsd/linux/other/b64/powerpc64.rs
+++ b/src/unix/notbsd/linux/other/b64/powerpc64.rs
@@ -1,5 +1,7 @@
//! PowerPC64-specific definitions for 64-bit linux-like values
+use pthread_mutex_t;
+
pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = u8;
@@ -373,60 +375,56 @@
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
-#[cfg(target_endian = "little")]
-pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
-#[cfg(target_endian = "little")]
-pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
-#[cfg(target_endian = "little")]
-pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
-#[cfg(target_endian = "big")]
-pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
-#[cfg(target_endian = "big")]
-pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
-#[cfg(target_endian = "big")]
-pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
+align_const! {
+ #[cfg(target_endian = "little")]
+ pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "little")]
+ pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "little")]
+ pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "big")]
+ pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "big")]
+ pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ #[cfg(target_endian = "big")]
+ pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+}
pub const O_DIRECTORY: ::c_int = 0x4000;
pub const O_NOFOLLOW: ::c_int = 0x8000;
diff --git a/src/unix/notbsd/linux/other/b64/sparc64.rs b/src/unix/notbsd/linux/other/b64/sparc64.rs
index 8deef06..34438a7 100644
--- a/src/unix/notbsd/linux/other/b64/sparc64.rs
+++ b/src/unix/notbsd/linux/other/b64/sparc64.rs
@@ -1,5 +1,7 @@
//! SPARC64-specific definitions for 64-bit linux-like values
+use pthread_mutex_t;
+
pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = i8;
@@ -349,30 +351,29 @@
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
-pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
-pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
-pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
+align_const! {
+ pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+}
pub const O_DIRECTORY: ::c_int = 0o200000;
pub const O_NOFOLLOW: ::c_int = 0o400000;
diff --git a/src/unix/notbsd/linux/other/b64/x32.rs b/src/unix/notbsd/linux/other/b64/x32.rs
index 9eb30c8..d88dbaf 100644
--- a/src/unix/notbsd/linux/other/b64/x32.rs
+++ b/src/unix/notbsd/linux/other/b64/x32.rs
@@ -1,3 +1,5 @@
+use pthread_mutex_t;
+
pub type c_long = i32;
pub type c_ulong = u32;
@@ -21,30 +23,29 @@
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 32;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 44;
-pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
-pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
-pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
+align_const! {
+ pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+}
// Syscall table
diff --git a/src/unix/notbsd/linux/s390x.rs b/src/unix/notbsd/linux/s390x.rs
index 5593222..9196f88 100644
--- a/src/unix/notbsd/linux/s390x.rs
+++ b/src/unix/notbsd/linux/s390x.rs
@@ -1,3 +1,5 @@
+use pthread_mutex_t;
+
pub type blkcnt_t = i64;
pub type blksize_t = i64;
pub type c_char = u8;
@@ -376,30 +378,29 @@
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
-pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
-pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
-pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
- ::pthread_mutex_t {
- __align: [],
- size: [
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- ],
- };
+align_const! {
+ pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+ pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t =
+ pthread_mutex_t {
+ size: [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ ],
+ };
+}
pub const EADDRINUSE: ::c_int = 98;
pub const EADDRNOTAVAIL: ::c_int = 99;
diff --git a/src/unix/uclibc/mod.rs b/src/unix/uclibc/mod.rs
index e9c1f21..e3606c2 100644
--- a/src/unix/uclibc/mod.rs
+++ b/src/unix/uclibc/mod.rs
@@ -224,34 +224,80 @@
pub ifa_data: *mut ::c_void
}
+ #[cfg_attr(all(feature = "align",
+ target_pointer_width = "32",
+ any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc")),
+ repr(align(4)))]
+ #[cfg_attr(all(feature = "align",
+ any(target_pointer_width = "64",
+ not(any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc")))),
+ repr(align(8)))]
pub struct pthread_mutex_t {
- #[cfg(any(target_arch = "mips", target_arch = "arm",
- target_arch = "powerpc"))]
+ #[cfg(all(not(feature = "align"),
+ any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc")))]
__align: [::c_long; 0],
- #[cfg(not(any(target_arch = "mips", target_arch = "arm",
+ #[cfg(not(any(feature = "align",
+ target_arch = "mips",
+ target_arch = "arm",
target_arch = "powerpc")))]
__align: [::c_longlong; 0],
size: [u8; __SIZEOF_PTHREAD_MUTEX_T],
}
+ #[cfg_attr(all(feature = "align",
+ target_pointer_width = "32",
+ any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc")),
+ repr(align(4)))]
+ #[cfg_attr(all(feature = "align",
+ any(target_pointer_width = "64",
+ not(any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc")))),
+ repr(align(8)))]
pub struct pthread_rwlock_t {
- #[cfg(any(target_arch = "mips", target_arch = "arm",
- target_arch = "powerpc"))]
+ #[cfg(all(not(feature = "align"),
+ any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc")))]
__align: [::c_long; 0],
- #[cfg(not(any(target_arch = "mips", target_arch = "arm",
+ #[cfg(not(any(feature = "align",
+ target_arch = "mips",
+ target_arch = "arm",
target_arch = "powerpc")))]
__align: [::c_longlong; 0],
size: [u8; __SIZEOF_PTHREAD_RWLOCK_T],
}
+ #[cfg_attr(all(feature = "align",
+ any(target_pointer_width = "32",
+ target_arch = "x86_64", target_arch = "powerpc64",
+ target_arch = "mips64", target_arch = "s390x",
+ target_arch = "sparc64")),
+ repr(align(4)))]
+ #[cfg_attr(all(feature = "align",
+ not(any(target_pointer_width = "32",
+ target_arch = "x86_64", target_arch = "powerpc64",
+ target_arch = "mips64", target_arch = "s390x",
+ target_arch = "sparc64"))),
+ repr(align(8)))]
pub struct pthread_mutexattr_t {
- #[cfg(any(target_arch = "x86_64", target_arch = "powerpc64",
- target_arch = "mips64", target_arch = "s390x",
- target_arch = "sparc64"))]
- __align: [::c_int; 0],
- #[cfg(not(any(target_arch = "x86_64", target_arch = "powerpc64",
+ #[cfg(all(not(feature = "align"),
+ any(target_arch = "x86_64", target_arch = "powerpc64",
target_arch = "mips64", target_arch = "s390x",
target_arch = "sparc64")))]
+ __align: [::c_int; 0],
+ #[cfg(all(not(feature = "align"),
+ not(any(target_arch = "x86_64", target_arch = "powerpc64",
+ target_arch = "mips64", target_arch = "s390x",
+ target_arch = "sparc64"))))]
__align: [::c_long; 0],
size: [u8; __SIZEOF_PTHREAD_MUTEXATTR_T],
}
@@ -261,12 +307,16 @@
__pshared: ::c_int,
}
+ #[cfg_attr(feature = "align", repr(align(8)))]
pub struct pthread_cond_t {
+ #[cfg(not(feature = "align"))]
__align: [::c_longlong; 0],
size: [u8; __SIZEOF_PTHREAD_COND_T],
}
+ #[cfg_attr(feature = "align", repr(align(4)))]
pub struct pthread_condattr_t {
+ #[cfg(not(feature = "align"))]
__align: [::c_int; 0],
size: [u8; __SIZEOF_PTHREAD_CONDATTR_T],
}
@@ -1116,18 +1166,17 @@
pub const TCP_MD5SIG: ::c_int = 14;
-pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
- __align: [],
- size: [0; __SIZEOF_PTHREAD_MUTEX_T],
-};
-pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
- __align: [],
- size: [0; __SIZEOF_PTHREAD_COND_T],
-};
-pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
- __align: [],
- size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
-};
+align_const! {
+ pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
+ size: [0; __SIZEOF_PTHREAD_MUTEX_T],
+ };
+ pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
+ size: [0; __SIZEOF_PTHREAD_COND_T],
+ };
+ pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
+ size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
+ };
+}
pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
diff --git a/src/unix/uclibc/x86_64/mod.rs b/src/unix/uclibc/x86_64/mod.rs
index dac9107..bc6571a 100644
--- a/src/unix/uclibc/x86_64/mod.rs
+++ b/src/unix/uclibc/x86_64/mod.rs
@@ -218,43 +218,93 @@
__align: [::c_long; 0],
}
+ #[cfg_attr(all(feature = "align",
+ target_pointer_width = "32",
+ any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc")),
+ repr(align(4)))]
+ #[cfg_attr(all(feature = "align",
+ any(target_pointer_width = "64",
+ not(any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc")))),
+ repr(align(8)))]
pub struct pthread_mutex_t { // ToDo
- #[cfg(any(target_arch = "mips", target_arch = "arm",
- target_arch = "powerpc"))]
+ #[cfg(all(not(feature = "align"),
+ any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc")))]
__align: [::c_long; 0],
- #[cfg(not(any(target_arch = "mips", target_arch = "arm",
+ #[cfg(not(any(feature = "align",
+ target_arch = "mips",
+ target_arch = "arm",
target_arch = "powerpc")))]
__align: [::c_longlong; 0],
size: [u8; __SIZEOF_PTHREAD_MUTEX_T],
}
+ #[cfg_attr(all(feature = "align",
+ any(target_pointer_width = "32",
+ target_arch = "x86_64", target_arch = "powerpc64",
+ target_arch = "mips64", target_arch = "s390x",
+ target_arch = "sparc64")),
+ repr(align(4)))]
+ #[cfg_attr(all(feature = "align",
+ not(any(target_pointer_width = "32",
+ target_arch = "x86_64", target_arch = "powerpc64",
+ target_arch = "mips64", target_arch = "s390x",
+ target_arch = "sparc64"))),
+ repr(align(8)))]
pub struct pthread_mutexattr_t { // ToDo
- #[cfg(any(target_arch = "x86_64", target_arch = "powerpc64",
- target_arch = "mips64", target_arch = "s390x",
- target_arch = "sparc64"))]
- __align: [::c_int; 0],
- #[cfg(not(any(target_arch = "x86_64", target_arch = "powerpc64",
+ #[cfg(all(not(feature = "align"),
+ any(target_arch = "x86_64", target_arch = "powerpc64",
target_arch = "mips64", target_arch = "s390x",
target_arch = "sparc64")))]
+ __align: [::c_int; 0],
+ #[cfg(all(not(feature = "align"),
+ not(any(target_arch = "x86_64", target_arch = "powerpc64",
+ target_arch = "mips64", target_arch = "s390x",
+ target_arch = "sparc64"))))]
__align: [::c_long; 0],
size: [u8; __SIZEOF_PTHREAD_MUTEXATTR_T],
}
+ #[cfg_attr(feature = "align", repr(align(8)))]
pub struct pthread_cond_t { // ToDo
+ #[cfg(not(feature = "align"))]
__align: [::c_longlong; 0],
size: [u8; __SIZEOF_PTHREAD_COND_T],
}
+ #[cfg_attr(feature = "align", repr(align(4)))]
pub struct pthread_condattr_t { // ToDo
+ #[cfg(not(feature = "align"))]
__align: [::c_int; 0],
size: [u8; __SIZEOF_PTHREAD_CONDATTR_T],
}
+ #[cfg_attr(all(feature = "align",
+ target_pointer_width = "32",
+ any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc")),
+ repr(align(4)))]
+ #[cfg_attr(all(feature = "align",
+ any(target_pointer_width = "64",
+ not(any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc")))),
+ repr(align(8)))]
pub struct pthread_rwlock_t { // ToDo
- #[cfg(any(target_arch = "mips", target_arch = "arm",
- target_arch = "powerpc"))]
+ #[cfg(all(not(feature = "align"),
+ any(target_arch = "mips",
+ target_arch = "arm",
+ target_arch = "powerpc")))]
__align: [::c_long; 0],
- #[cfg(not(any(target_arch = "mips", target_arch = "arm",
+ #[cfg(not(any(feature = "align",
+ target_arch = "mips",
+ target_arch = "arm",
target_arch = "powerpc")))]
__align: [::c_longlong; 0],
size: [u8; __SIZEOF_PTHREAD_RWLOCK_T],