Skip to content

Commit fe8470b

Browse files
committed
uclibc -> linux-like/linux: mostly mechanical removal of redundant symbols
1 parent c4803a6 commit fe8470b

File tree

21 files changed

+673
-2562
lines changed

21 files changed

+673
-2562
lines changed

src/unix/linux_like/linux/mod.rs

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,18 @@ s! {
302302
#[cfg(target_pointer_width = "32")]
303303
pub dlpi_phnum: Elf32_Half,
304304

305+
// As of uClibc 1.0.36, the following fields are
306+
// gated behind a "#if 0" block which always evaluates
307+
// to false. So I'm just removing these, and if uClibc changes
308+
// the #if block in the future to include the following fields, these
309+
// will probably need including here. tsidea, skrap
310+
#[cfg(not(target_env = "uclibc"))]
305311
pub dlpi_adds: ::c_ulonglong,
312+
#[cfg(not(target_env = "uclibc"))]
306313
pub dlpi_subs: ::c_ulonglong,
314+
#[cfg(not(target_env = "uclibc"))]
307315
pub dlpi_tls_modid: ::size_t,
316+
#[cfg(not(target_env = "uclibc"))]
308317
pub dlpi_tls_data: *mut ::c_void,
309318
}
310319

@@ -2792,20 +2801,8 @@ f! {
27922801
}
27932802
}
27942803

2804+
#[cfg(not(target_env = "uclibc"))]
27952805
extern "C" {
2796-
#[cfg_attr(not(target_env = "musl"), link_name = "__xpg_strerror_r")]
2797-
pub fn strerror_r(
2798-
errnum: ::c_int,
2799-
buf: *mut c_char,
2800-
buflen: ::size_t,
2801-
) -> ::c_int;
2802-
2803-
pub fn abs(i: ::c_int) -> ::c_int;
2804-
pub fn atof(s: *const ::c_char) -> ::c_double;
2805-
pub fn labs(i: ::c_long) -> ::c_long;
2806-
pub fn rand() -> ::c_int;
2807-
pub fn srand(seed: ::c_uint);
2808-
28092806
pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
28102807
pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
28112808
pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
@@ -2823,6 +2820,22 @@ extern "C" {
28232820
nitems: ::c_int,
28242821
sevp: *mut ::sigevent,
28252822
) -> ::c_int;
2823+
}
2824+
2825+
2826+
extern "C" {
2827+
#[cfg_attr(not(target_env = "musl"), link_name = "__xpg_strerror_r")]
2828+
pub fn strerror_r(
2829+
errnum: ::c_int,
2830+
buf: *mut c_char,
2831+
buflen: ::size_t,
2832+
) -> ::c_int;
2833+
2834+
pub fn abs(i: ::c_int) -> ::c_int;
2835+
pub fn atof(s: *const ::c_char) -> ::c_double;
2836+
pub fn labs(i: ::c_long) -> ::c_long;
2837+
pub fn rand() -> ::c_int;
2838+
pub fn srand(seed: ::c_uint);
28262839

28272840
pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
28282841

@@ -3594,7 +3607,10 @@ extern "C" {
35943607
}
35953608

35963609
cfg_if! {
3597-
if #[cfg(target_env = "musl")] {
3610+
if #[cfg(target_env = "uclibc")] {
3611+
mod uclibc;
3612+
pub use self::uclibc::*;
3613+
} else if #[cfg(target_env = "musl")] {
35983614
mod musl;
35993615
pub use self::musl::*;
36003616
} else if #[cfg(target_env = "gnu")] {
File renamed without changes.

0 commit comments

Comments
 (0)