]> git.proxmox.com Git - cargo.git/blob - vendor/libc/src/unix/linux_like/emscripten/no_align.rs
New upstream version 0.37.0
[cargo.git] / vendor / libc / src / unix / linux_like / emscripten / no_align.rs
1 macro_rules! expand_align {
2 () => {
3 s! {
4 pub struct pthread_mutex_t {
5 __align: [::c_long; 0],
6 size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
7 }
8
9 pub struct pthread_rwlock_t {
10 __align: [::c_long; 0],
11 size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
12 }
13
14 pub struct pthread_mutexattr_t {
15 __align: [::c_int; 0],
16 size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
17 }
18
19 pub struct pthread_rwlockattr_t {
20 __align: [::c_int; 0],
21 size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T],
22 }
23
24 pub struct pthread_condattr_t {
25 __align: [::c_int; 0],
26 size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
27 }
28 }
29
30 s_no_extra_traits! {
31 pub struct pthread_cond_t {
32 __align: [*const ::c_void; 0],
33 size: [u8; ::__SIZEOF_PTHREAD_COND_T],
34 }
35 }
36
37 cfg_if! {
38 if #[cfg(feature = "extra_traits")] {
39 impl PartialEq for pthread_cond_t {
40 fn eq(&self, other: &pthread_cond_t) -> bool {
41 self.size
42 .iter()
43 .zip(other.size.iter())
44 .all(|(a,b)| a == b)
45 }
46 }
47 impl Eq for pthread_cond_t {}
48 impl ::fmt::Debug for pthread_cond_t {
49 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
50 f.debug_struct("pthread_cond_t")
51 // FIXME: .field("size", &self.size)
52 .finish()
53 }
54 }
55 impl ::hash::Hash for pthread_cond_t {
56 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
57 self.size.hash(state);
58 }
59 }
60 }
61 }
62 }
63 }