]> git.proxmox.com Git - rustc.git/blame - vendor/libc/src/unix/linux_like/emscripten/align.rs
New upstream version 1.44.1+dfsg1
[rustc.git] / vendor / libc / src / unix / linux_like / emscripten / align.rs
CommitLineData
532ac7d7
XL
1macro_rules! expand_align {
2 () => {
3 s! {
e74abb32 4 #[allow(missing_debug_implementations)]
532ac7d7
XL
5 #[repr(align(4))]
6 pub struct pthread_mutex_t {
7 size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
8 }
9
10 #[repr(align(4))]
11 pub struct pthread_rwlock_t {
12 size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
13 }
14
15 #[repr(align(4))]
16 pub struct pthread_mutexattr_t {
17 size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
18 }
19
20 #[repr(align(4))]
21 pub struct pthread_rwlockattr_t {
22 size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T],
23 }
24
25 #[repr(align(4))]
26 pub struct pthread_condattr_t {
27 size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
28 }
29 }
30
31 s_no_extra_traits! {
32 #[cfg_attr(target_pointer_width = "32",
33 repr(align(4)))]
34 #[cfg_attr(target_pointer_width = "64",
35 repr(align(8)))]
36 pub struct pthread_cond_t {
37 size: [u8; ::__SIZEOF_PTHREAD_COND_T],
38 }
e74abb32
XL
39
40 #[allow(missing_debug_implementations)]
ba9703b0 41 #[repr(align(16))]
e74abb32 42 pub struct max_align_t {
ba9703b0 43 priv_: [f64; 4]
e74abb32
XL
44 }
45
532ac7d7
XL
46 }
47
48 cfg_if! {
49 if #[cfg(feature = "extra_traits")] {
50 impl PartialEq for pthread_cond_t {
51 fn eq(&self, other: &pthread_cond_t) -> bool {
52 self.size
53 .iter()
54 .zip(other.size.iter())
55 .all(|(a,b)| a == b)
56 }
57 }
58 impl Eq for pthread_cond_t {}
59 impl ::fmt::Debug for pthread_cond_t {
60 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
61 f.debug_struct("pthread_cond_t")
62 // FIXME: .field("size", &self.size)
63 .finish()
64 }
65 }
66 impl ::hash::Hash for pthread_cond_t {
67 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
68 self.size.hash(state);
69 }
70 }
71 }
72 }
e74abb32 73 };
532ac7d7 74}