Skip to content

Commit 697e365

Browse files
committed
newlib: Fix ambiguous glob exports and other warnings for Vita and 3DS
1 parent d5a75f3 commit 697e365

File tree

8 files changed

+13
-48
lines changed

8 files changed

+13
-48
lines changed

src/new/vita/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
//! VITASDK system library.
22
// FIXME(vita): link to headers or manpages needed.
3-
4-
pub(crate) mod unistd;

src/new/vita/unistd.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/unix/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ s! {
142142
pub ipv6mr_interface: c_uint,
143143
}
144144

145-
#[cfg(not(target_os = "cygwin"))]
145+
#[cfg(all(not(target_os = "cygwin"), not(target_os = "horizon")))]
146146
pub struct hostent {
147147
pub h_name: *mut c_char,
148148
pub h_aliases: *mut *mut c_char,
@@ -156,6 +156,7 @@ s! {
156156
pub iov_len: size_t,
157157
}
158158

159+
#[cfg(not(target_os = "horizon"))]
159160
pub struct pollfd {
160161
pub fd: c_int,
161162
pub events: c_short,

src/unix/newlib/generic.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
//! Common types used by most newlib platforms
22
3-
use crate::off_t;
3+
#[allow(unused_imports)] // needed for platforms that don't use the prelude here
44
use crate::prelude::*;
55

66
s! {
7+
#[cfg(all(not(target_os = "vita"), not(target_os = "horizon")))]
78
pub struct sigset_t {
8-
#[cfg(target_os = "horizon")]
9-
__val: [c_ulong; 16],
10-
#[cfg(not(target_os = "horizon"))]
119
__val: u32,
1210
}
1311

12+
#[cfg(all(not(target_os = "vita"), not(target_os = "horizon")))]
1413
pub struct stat {
1514
pub st_dev: crate::dev_t,
1615
pub st_ino: crate::ino_t,
@@ -19,7 +18,7 @@ s! {
1918
pub st_uid: crate::uid_t,
2019
pub st_gid: crate::gid_t,
2120
pub st_rdev: crate::dev_t,
22-
pub st_size: off_t,
21+
pub st_size: crate::off_t,
2322
pub st_atime: crate::time_t,
2423
pub st_spare1: c_long,
2524
pub st_mtime: crate::time_t,
@@ -31,6 +30,7 @@ s! {
3130
pub st_spare4: [c_long; 2usize],
3231
}
3332

33+
#[cfg(not(target_os = "vita"))]
3434
pub struct dirent {
3535
pub d_ino: crate::ino_t,
3636
pub d_type: c_uchar,

src/unix/newlib/horizon/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ s! {
2828
pub h_addr_list: *mut *mut c_char,
2929
}
3030

31+
pub struct pollfd {
32+
pub fd: c_int,
33+
pub events: c_int,
34+
pub revents: c_int,
35+
}
36+
3137
pub struct sockaddr {
3238
pub sa_family: crate::sa_family_t,
3339
pub sa_data: [c_char; 26usize],
@@ -141,9 +147,6 @@ pub const MSG_MORE: c_int = 0;
141147
pub const MSG_NOSIGNAL: c_int = 0;
142148
pub const SOL_CONFIG: c_uint = 65534;
143149

144-
pub const _SC_PAGESIZE: c_int = 8;
145-
pub const _SC_GETPW_R_SIZE_MAX: c_int = 51;
146-
147150
pub const PTHREAD_STACK_MIN: size_t = 4096;
148151
pub const WNOHANG: c_int = 1;
149152

src/unix/newlib/mod.rs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,6 @@ cfg_if! {
6464
}
6565
}
6666

67-
cfg_if! {
68-
if #[cfg(not(target_os = "horizon"))] {
69-
s! {
70-
pub struct hostent {
71-
pub h_name: *mut c_char,
72-
pub h_aliases: *mut *mut c_char,
73-
pub h_addrtype: c_int,
74-
pub h_length: c_int,
75-
pub h_addr_list: *mut *mut c_char,
76-
pub h_addr: *mut c_char,
77-
}
78-
}
79-
}
80-
}
81-
8267
s! {
8368
// The order of the `ai_addr` field in this struct is crucial
8469
// for converting between the Rust and C types.
@@ -108,21 +93,10 @@ s! {
10893
pub imr_interface: in_addr,
10994
}
11095

111-
pub struct linger {
112-
pub l_onoff: c_int,
113-
pub l_linger: c_int,
114-
}
115-
11696
pub struct in_addr {
11797
pub s_addr: crate::in_addr_t,
11898
}
11999

120-
pub struct pollfd {
121-
pub fd: c_int,
122-
pub events: c_int,
123-
pub revents: c_int,
124-
}
125-
126100
pub struct lconv {
127101
pub decimal_point: *mut c_char,
128102
pub thousands_sep: *mut c_char,

src/unix/newlib/rtems/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ pub const EAI_SERVICE: c_int = 9;
7373
pub const EAI_SYSTEM: c_int = 11;
7474
pub const EAI_OVERFLOW: c_int = 14;
7575

76-
pub const _SC_PAGESIZE: c_int = 8;
77-
pub const _SC_GETPW_R_SIZE_MAX: c_int = 51;
7876
pub const PTHREAD_STACK_MIN: size_t = 0;
7977

8078
// sys/wait.h

src/unix/newlib/vita/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,6 @@ pub const EAI_MEMORY: c_int = -10;
164164
pub const EAI_SYSTEM: c_int = -11;
165165
pub const EAI_OVERFLOW: c_int = -12;
166166

167-
pub const _SC_PAGESIZE: c_int = 8;
168-
pub const _SC_GETPW_R_SIZE_MAX: c_int = 51;
169167
pub const PTHREAD_STACK_MIN: size_t = 32 * 1024;
170168

171169
pub const IP_HDRINCL: c_int = 2;

0 commit comments

Comments
 (0)