Skip to content

Commit 5179441

Browse files
committed
Fix uclibc build errors
1 parent 278c565 commit 5179441

File tree

2 files changed

+53
-44
lines changed

2 files changed

+53
-44
lines changed

src/unix/uclibc/align.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,18 @@ macro_rules! expand_align {
4747
size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
4848
}
4949

50-
#[repr(align(8))]
51-
pub struct pthread_cond_t {
52-
size: [u8; ::__SIZEOF_PTHREAD_COND_T],
53-
}
54-
5550
#[repr(align(4))]
5651
pub struct pthread_condattr_t {
5752
size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
5853
}
5954
}
55+
56+
s_no_extra_traits! {
57+
#[repr(align(8))]
58+
#[allow(missing_debug_implementations)]
59+
pub struct pthread_cond_t {
60+
size: [u8; ::__SIZEOF_PTHREAD_COND_T],
61+
}
62+
}
6063
}
6164
}

src/unix/uclibc/mod.rs

Lines changed: 45 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,6 @@ s! {
6666
pub sin6_scope_id: u32,
6767
}
6868

69-
pub struct sockaddr_un {
70-
pub sun_family: sa_family_t,
71-
pub sun_path: [::c_char; 108]
72-
}
73-
74-
pub struct sockaddr_storage {
75-
pub ss_family: sa_family_t,
76-
__ss_align: ::size_t,
77-
#[cfg(target_pointer_width = "32")]
78-
__ss_pad2: [u8; 128 - 2 * 4],
79-
#[cfg(target_pointer_width = "64")]
80-
__ss_pad2: [u8; 128 - 2 * 8],
81-
}
82-
8369
pub struct addrinfo {
8470
pub ai_flags: ::c_int,
8571
pub ai_family: ::c_int,
@@ -140,15 +126,6 @@ s! {
140126
pub dli_saddr: *mut ::c_void,
141127
}
142128

143-
pub struct utsname {
144-
pub sysname: [::c_char; 65],
145-
pub nodename: [::c_char; 65],
146-
pub release: [::c_char; 65],
147-
pub version: [::c_char; 65],
148-
pub machine: [::c_char; 65],
149-
pub domainname: [::c_char; 65]
150-
}
151-
152129
pub struct lconv {
153130
pub decimal_point: *mut ::c_char,
154131
pub thousands_sep: *mut ::c_char,
@@ -189,22 +166,6 @@ s! {
189166
__unused1: [::c_int; 12]
190167
}
191168

192-
pub struct dirent {
193-
pub d_ino: ::ino_t,
194-
pub d_off: ::off_t,
195-
pub d_reclen: ::c_ushort,
196-
pub d_type: ::c_uchar,
197-
pub d_name: [::c_char; 256],
198-
}
199-
200-
pub struct dirent64 {
201-
pub d_ino: ::ino64_t,
202-
pub d_off: ::off64_t,
203-
pub d_reclen: ::c_ushort,
204-
pub d_type: ::c_uchar,
205-
pub d_name: [::c_char; 256],
206-
}
207-
208169
pub struct rlimit64 {
209170
pub rlim_cur: rlim64_t,
210171
pub rlim_max: rlim64_t,
@@ -358,10 +319,55 @@ s_no_extra_traits! {
358319
any(target_arch = "x86", target_arch = "x86_64"),
359320
repr(packed)
360321
)]
322+
#[allow(missing_debug_implementations)]
361323
pub struct epoll_event {
362324
pub events: ::uint32_t,
363325
pub u64: ::uint64_t,
364326
}
327+
328+
#[allow(missing_debug_implementations)]
329+
pub struct sockaddr_un {
330+
pub sun_family: sa_family_t,
331+
pub sun_path: [::c_char; 108]
332+
}
333+
334+
#[allow(missing_debug_implementations)]
335+
pub struct sockaddr_storage {
336+
pub ss_family: sa_family_t,
337+
__ss_align: ::size_t,
338+
#[cfg(target_pointer_width = "32")]
339+
__ss_pad2: [u8; 128 - 2 * 4],
340+
#[cfg(target_pointer_width = "64")]
341+
__ss_pad2: [u8; 128 - 2 * 8],
342+
}
343+
344+
#[allow(missing_debug_implementations)]
345+
pub struct utsname {
346+
pub sysname: [::c_char; 65],
347+
pub nodename: [::c_char; 65],
348+
pub release: [::c_char; 65],
349+
pub version: [::c_char; 65],
350+
pub machine: [::c_char; 65],
351+
pub domainname: [::c_char; 65]
352+
}
353+
354+
#[allow(missing_debug_implementations)]
355+
pub struct dirent {
356+
pub d_ino: ::ino_t,
357+
pub d_off: ::off_t,
358+
pub d_reclen: ::c_ushort,
359+
pub d_type: ::c_uchar,
360+
pub d_name: [::c_char; 256],
361+
}
362+
363+
#[allow(missing_debug_implementations)]
364+
pub struct dirent64 {
365+
pub d_ino: ::ino64_t,
366+
pub d_off: ::off64_t,
367+
pub d_reclen: ::c_ushort,
368+
pub d_type: ::c_uchar,
369+
pub d_name: [::c_char; 256],
370+
}
365371
}
366372

367373
// intentionally not public, only used for fd_set

0 commit comments

Comments
 (0)