1macro_rules! expand_align {
2 () => {
3 s! {
4 #[cfg_attr(any(target_pointer_width = "32",
5 target_arch = "x86_64",
6 target_arch = "powerpc64",
7 target_arch = "mips64",
8 target_arch = "mips64r6",
9 target_arch = "s390x",
10 target_arch = "sparc64",
11 target_arch = "aarch64",
12 target_arch = "riscv64",
13 target_arch = "riscv32",
14 target_arch = "loongarch64"),
15 repr(align(4)))]
16 #[cfg_attr(not(any(target_pointer_width = "32",
17 target_arch = "x86_64",
18 target_arch = "powerpc64",
19 target_arch = "mips64",
20 target_arch = "mips64r6",
21 target_arch = "s390x",
22 target_arch = "sparc64",
23 target_arch = "aarch64",
24 target_arch = "riscv64",
25 target_arch = "riscv32",
26 target_arch = "loongarch64")),
27 repr(align(8)))]
28 pub struct pthread_mutexattr_t {
29 #[doc(hidden)]
30 size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
31 }
32
33 #[cfg_attr(any(target_env = "musl", target_env = "ohos", target_pointer_width = "32"),
34 repr(align(4)))]
35 #[cfg_attr(all(not(target_env = "musl"),
36 not(target_env = "ohos"),
37 target_pointer_width = "64"),
38 repr(align(8)))]
39 pub struct pthread_rwlockattr_t {
40 #[doc(hidden)]
41 size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T],
42 }
43
44 #[repr(align(4))]
45 pub struct pthread_condattr_t {
46 #[doc(hidden)]
47 size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
48 }
49
50 #[repr(align(4))]
51 pub struct pthread_barrierattr_t {
52 #[doc(hidden)]
53 size: [u8; ::__SIZEOF_PTHREAD_BARRIERATTR_T],
54 }
55
56 #[repr(align(8))]
57 pub struct fanotify_event_metadata {
58 pub event_len: __u32,
59 pub vers: __u8,
60 pub reserved: __u8,
61 pub metadata_len: __u16,
62 pub mask: __u64,
63 pub fd: ::c_int,
64 pub pid: ::c_int,
65 }
66 }
67
68 s_no_extra_traits! {
69 #[cfg_attr(all(any(target_env = "musl", target_env = "ohos"),
70 target_pointer_width = "32"),
71 repr(align(4)))]
72 #[cfg_attr(all(any(target_env = "musl", target_env = "ohos"),
73 target_pointer_width = "64"),
74 repr(align(8)))]
75 #[cfg_attr(all(not(any(target_env = "musl", target_env = "ohos")),
76 target_arch = "x86"),
77 repr(align(4)))]
78 #[cfg_attr(all(not(any(target_env = "musl", target_env = "ohos")),
79 not(target_arch = "x86")),
80 repr(align(8)))]
81 pub struct pthread_cond_t {
82 #[doc(hidden)]
83 size: [u8; ::__SIZEOF_PTHREAD_COND_T],
84 }
85
86 #[cfg_attr(all(target_pointer_width = "32",
87 any(target_arch = "mips",
88 target_arch = "mips32r6",
89 target_arch = "arm",
90 target_arch = "hexagon",
91 target_arch = "m68k",
92 target_arch = "csky",
93 target_arch = "powerpc",
94 target_arch = "sparc",
95 target_arch = "x86_64",
96 target_arch = "x86")),
97 repr(align(4)))]
98 #[cfg_attr(any(target_pointer_width = "64",
99 not(any(target_arch = "mips",
100 target_arch = "mips32r6",
101 target_arch = "arm",
102 target_arch = "hexagon",
103 target_arch = "m68k",
104 target_arch = "csky",
105 target_arch = "powerpc",
106 target_arch = "sparc",
107 target_arch = "x86_64",
108 target_arch = "x86"))),
109 repr(align(8)))]
110 pub struct pthread_mutex_t {
111 #[doc(hidden)]
112 size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
113 }
114
115 #[cfg_attr(all(target_pointer_width = "32",
116 any(target_arch = "mips",
117 target_arch = "mips32r6",
118 target_arch = "arm",
119 target_arch = "hexagon",
120 target_arch = "m68k",
121 target_arch = "csky",
122 target_arch = "powerpc",
123 target_arch = "sparc",
124 target_arch = "x86_64",
125 target_arch = "x86")),
126 repr(align(4)))]
127 #[cfg_attr(any(target_pointer_width = "64",
128 not(any(target_arch = "mips",
129 target_arch = "mips32r6",
130 target_arch = "arm",
131 target_arch = "hexagon",
132 target_arch = "m68k",
133 target_arch = "powerpc",
134 target_arch = "sparc",
135 target_arch = "x86_64",
136 target_arch = "x86"))),
137 repr(align(8)))]
138 pub struct pthread_rwlock_t {
139 size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
140 }
141
142 #[cfg_attr(all(target_pointer_width = "32",
143 any(target_arch = "mips",
144 target_arch = "mips32r6",
145 target_arch = "arm",
146 target_arch = "hexagon",
147 target_arch = "m68k",
148 target_arch = "csky",
149 target_arch = "powerpc",
150 target_arch = "sparc",
151 target_arch = "x86_64",
152 target_arch = "x86")),
153 repr(align(4)))]
154 #[cfg_attr(any(target_pointer_width = "64",
155 not(any(target_arch = "mips",
156 target_arch = "mips32r6",
157 target_arch = "arm",
158 target_arch = "hexagon",
159 target_arch = "m68k",
160 target_arch = "csky",
161 target_arch = "powerpc",
162 target_arch = "sparc",
163 target_arch = "x86_64",
164 target_arch = "x86"))),
165 repr(align(8)))]
166 pub struct pthread_barrier_t {
167 size: [u8; ::__SIZEOF_PTHREAD_BARRIER_T],
168 }
169
170 // linux/can.h
171 #[repr(align(8))]
172 #[allow(missing_debug_implementations)]
173 pub struct can_frame {
174 pub can_id: canid_t,
175 pub can_dlc: u8,
176 __pad: u8,
177 __res0: u8,
178 __res1: u8,
179 pub data: [u8; CAN_MAX_DLEN],
180 }
181
182 #[repr(align(8))]
183 #[allow(missing_debug_implementations)]
184 pub struct canfd_frame {
185 pub can_id: canid_t,
186 pub len: u8,
187 pub flags: u8,
188 __res0: u8,
189 __res1: u8,
190 pub data: [u8; CANFD_MAX_DLEN],
191 }
192
193 #[repr(align(8))]
194 #[allow(missing_debug_implementations)]
195 pub struct canxl_frame {
196 pub prio: canid_t,
197 pub flags: u8,
198 pub sdt: u8,
199 pub len: u16,
200 pub af: u32,
201 pub data: [u8; CANXL_MAX_DLEN],
202 }
203 }
204 };
205}
206