Skip to content

Commit 183c51b

Browse files
committed
Fix uclibc l4re
1 parent 5179441 commit 183c51b

File tree

4 files changed

+74
-63
lines changed

4 files changed

+74
-63
lines changed

src/unix/uclibc/align.rs

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,6 @@
11
macro_rules! expand_align {
22
() => {
33
s! {
4-
#[cfg_attr(all(target_pointer_width = "32",
5-
any(target_arch = "mips",
6-
target_arch = "arm",
7-
target_arch = "powerpc")),
8-
repr(align(4)))]
9-
#[cfg_attr(any(target_pointer_width = "64",
10-
not(any(target_arch = "mips",
11-
target_arch = "arm",
12-
target_arch = "powerpc"))),
13-
repr(align(8)))]
14-
pub struct pthread_mutex_t {
15-
size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
16-
}
17-
18-
#[cfg_attr(all(target_pointer_width = "32",
19-
any(target_arch = "mips",
20-
target_arch = "arm",
21-
target_arch = "powerpc")),
22-
repr(align(4)))]
23-
#[cfg_attr(any(target_pointer_width = "64",
24-
not(any(target_arch = "mips",
25-
target_arch = "arm",
26-
target_arch = "powerpc"))),
27-
repr(align(8)))]
28-
pub struct pthread_rwlock_t {
29-
size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
30-
}
31-
324
#[cfg_attr(any(target_pointer_width = "32",
335
target_arch = "x86_64",
346
target_arch = "powerpc64",
@@ -59,6 +31,36 @@ macro_rules! expand_align {
5931
pub struct pthread_cond_t {
6032
size: [u8; ::__SIZEOF_PTHREAD_COND_T],
6133
}
34+
35+
#[cfg_attr(all(target_pointer_width = "32",
36+
any(target_arch = "mips",
37+
target_arch = "arm",
38+
target_arch = "powerpc")),
39+
repr(align(4)))]
40+
#[cfg_attr(any(target_pointer_width = "64",
41+
not(any(target_arch = "mips",
42+
target_arch = "arm",
43+
target_arch = "powerpc"))),
44+
repr(align(8)))]
45+
#[allow(missing_debug_implementations)]
46+
pub struct pthread_mutex_t {
47+
size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
48+
}
49+
50+
#[cfg_attr(all(target_pointer_width = "32",
51+
any(target_arch = "mips",
52+
target_arch = "arm",
53+
target_arch = "powerpc")),
54+
repr(align(4)))]
55+
#[cfg_attr(any(target_pointer_width = "64",
56+
not(any(target_arch = "mips",
57+
target_arch = "arm",
58+
target_arch = "powerpc"))),
59+
repr(align(8)))]
60+
#[allow(missing_debug_implementations)]
61+
pub struct pthread_rwlock_t {
62+
size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
63+
}
6264
}
6365
}
6466
}

src/unix/uclibc/x86_64/align.rs

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@ macro_rules! expand_align {
1212
__size: [::c_char; 32],
1313
}
1414

15-
#[cfg_attr(all(target_pointer_width = "32",
16-
any(target_arch = "mips",
17-
target_arch = "arm",
18-
target_arch = "powerpc")),
19-
repr(align(4)))]
20-
#[cfg_attr(all(any(target_pointer_width = "64",
21-
not(any(target_arch = "mips",
22-
target_arch = "arm",
23-
target_arch = "powerpc")))),
24-
repr(align(8)))]
25-
pub struct pthread_mutex_t { // ToDo
26-
size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
27-
}
28-
2915
#[cfg_attr(any(target_pointer_width = "32",
3016
target_arch = "x86_64",
3117
target_arch = "powerpc64",
@@ -44,15 +30,33 @@ macro_rules! expand_align {
4430
size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
4531
}
4632

47-
#[repr(align(8))]
48-
pub struct pthread_cond_t { // ToDo
49-
size: [u8; ::__SIZEOF_PTHREAD_COND_T],
50-
}
51-
5233
#[repr(align(4))]
5334
pub struct pthread_condattr_t { // ToDo
5435
size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
5536
}
37+
}
38+
39+
s_no_extra_traits! {
40+
#[cfg_attr(all(target_pointer_width = "32",
41+
any(target_arch = "mips",
42+
target_arch = "arm",
43+
target_arch = "powerpc")),
44+
repr(align(4)))]
45+
#[cfg_attr(all(any(target_pointer_width = "64",
46+
not(any(target_arch = "mips",
47+
target_arch = "arm",
48+
target_arch = "powerpc")))),
49+
repr(align(8)))]
50+
#[allow(missing_debug_implementations)]
51+
pub struct pthread_mutex_t { // ToDo
52+
size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
53+
}
54+
55+
#[repr(align(8))]
56+
#[allow(missing_debug_implementations)]
57+
pub struct pthread_cond_t { // ToDo
58+
size: [u8; ::__SIZEOF_PTHREAD_COND_T],
59+
}
5660

5761
#[cfg_attr(all(target_pointer_width = "32",
5862
any(target_arch = "mips",
@@ -64,6 +68,7 @@ macro_rules! expand_align {
6468
target_arch = "arm",
6569
target_arch = "powerpc"))),
6670
repr(align(8)))]
71+
#[allow(missing_debug_implementations)]
6772
pub struct pthread_rwlock_t { // ToDo
6873
size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
6974
}

src/unix/uclibc/x86_64/l4re.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ s! {
2727
}
2828

2929
#[cfg(target_os = "l4re")]
30+
#[allow(missing_debug_implementations)]
3031
pub struct pthread_attr_t {
3132
pub __detachstate: ::c_int,
3233
pub __schedpolicy: ::c_int,

src/unix/uclibc/x86_64/mod.rs

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,6 @@ pub type time_t = ::c_int;
2020
pub type wchar_t = ::c_int;
2121

2222
s! {
23-
pub struct dirent {
24-
pub d_ino: ::ino64_t,
25-
pub d_off: ::off64_t,
26-
pub d_reclen: u16,
27-
pub d_type: u8,
28-
pub d_name: [::c_char; 256],
29-
}
30-
31-
pub struct dirent64 {
32-
pub d_ino: ::ino64_t,
33-
pub d_off: ::off64_t,
34-
pub d_reclen: u16,
35-
pub d_type: u8,
36-
pub d_name: [::c_char; 256],
37-
}
38-
3923
pub struct ipc_perm {
4024
pub __key: ::key_t,
4125
pub uid: ::uid_t,
@@ -252,6 +236,25 @@ s! {
252236
}
253237
}
254238

239+
s_no_extra_traits! {
240+
#[allow(missing_debug_implementations)]
241+
pub struct dirent {
242+
pub d_ino: ::ino64_t,
243+
pub d_off: ::off64_t,
244+
pub d_reclen: u16,
245+
pub d_type: u8,
246+
pub d_name: [::c_char; 256],
247+
}
248+
#[allow(missing_debug_implementations)]
249+
pub struct dirent64 {
250+
pub d_ino: ::ino64_t,
251+
pub d_off: ::off64_t,
252+
pub d_reclen: u16,
253+
pub d_type: u8,
254+
pub d_name: [::c_char; 256],
255+
}
256+
}
257+
255258
// constants
256259
pub const EADDRINUSE: ::c_int = 98; // Address already in use
257260
pub const EADDRNOTAVAIL: ::c_int = 99; // Cannot assign requested address

0 commit comments

Comments
 (0)