Skip to content

Commit c14178c

Browse files
committed
Fix indentation, remove more constants that don't work for uclibc
1 parent 8c592f1 commit c14178c

File tree

7 files changed

+4
-155
lines changed

7 files changed

+4
-155
lines changed

libc-test/build.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,6 @@ fn main() {
319319
// This is actually a union, not a struct
320320
"sigval" => true,
321321

322-
// These structs didn't exist when uClibc was developed
323-
"aiocb" if uclibc => true,
324-
325322
_ => false
326323
}
327324
});
@@ -400,10 +397,6 @@ fn main() {
400397
"KERN_KDENABLE_BG_TRACE" if apple => true,
401398
"KERN_KDDISABLE_BG_TRACE" if apple => true,
402399

403-
// uClibc doesn't support a LOT of constants, because its latest release
404-
// was before they coud be implemented yet
405-
"LC_PAPER" | "LC_NAME" | "LC_ADDRESS" | "LC_TELEPHONE" | "LC_MEASUREMENT" | "LC_IDENTIFICATION" |
406-
"LC_PAPER_MASK" | "LC_NAME_MASK" | "LC_ADDRESS_MASK" | "LC_TELEPHONE_MASK" | "LC_MEASUREMENT_MASK" | "LC_IDENTIFICATION_MASK" | "LC_ALL_MASK" |
407400
// not entirely sure why these don't work...
408401
"LC_CTYPE_MASK" | "LC_NUMERIC_MASK" | "LC_TIME_MASK" | "LC_COLLATE_MASK" | "LC_MONETARY_MASK" | "LC_MESSAGES_MASK" |
409402
"MADV_MERGEABLE" | "MADV_UNMERGEABLE" | "MADV_HWPOISON" | "IPV6_ADD_MEMBERSHIP" | "IPV6_DROP_MEMBERSHIP" | "IPV6_MULTICAST_LOOP" | "IPV6_V6ONLY" |
@@ -498,7 +491,7 @@ fn main() {
498491
"fremovexattr" |
499492
"backtrace" |
500493
"sysinfo" | "newlocale" | "duplocale" | "freelocale" | "uselocale" |
501-
"nl_langinfo_l" | "wcslen" | "wcstombs" if uclibc && linux => true,
494+
"nl_langinfo_l" | "wcslen" | "wcstombs" if uclibc => true,
502495

503496
_ => false,
504497
}

src/unix/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -841,9 +841,9 @@ cfg_if! {
841841
mod uclibc;
842842
pub use self::uclibc::*;
843843
} else if #[cfg(any(target_os = "linux",
844-
target_os = "android",
845-
target_os = "emscripten",
846-
target_os = "fuchsia"))] {
844+
target_os = "android",
845+
target_os = "emscripten",
846+
target_os = "fuchsia"))] {
847847
mod notbsd;
848848
pub use self::notbsd::*;
849849
} else if #[cfg(any(target_os = "macos",

src/unix/uclibc/mips/mips32.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,6 @@ pub type fsfilcnt_t = ::c_ulong;
1515
pub type rlim_t = c_ulong;
1616

1717
s! {
18-
pub struct aiocb {
19-
pub aio_fildes: ::c_int,
20-
pub aio_lio_opcode: ::c_int,
21-
pub aio_reqprio: ::c_int,
22-
pub aio_buf: *mut ::c_void,
23-
pub aio_nbytes: ::size_t,
24-
pub aio_sigevent: ::sigevent,
25-
__next_prio: *mut aiocb,
26-
__abs_prio: ::c_int,
27-
__policy: ::c_int,
28-
__error_code: ::c_int,
29-
__return_value: ::ssize_t,
30-
pub aio_offset: off_t,
31-
__unused1: [::c_char; 4],
32-
__glibc_reserved: [::c_char; 32]
33-
}
34-
3518
pub struct stat {
3619
pub st_dev: ::dev_t,
3720
st_pad1: [::c_long; 2],

src/unix/uclibc/mips/mips64.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,6 @@ pub type time_t = i64;
1414
pub type wchar_t = i32;
1515

1616
s! {
17-
pub struct aiocb {
18-
pub aio_fildes: ::c_int,
19-
pub aio_lio_opcode: ::c_int,
20-
pub aio_reqprio: ::c_int,
21-
pub aio_buf: *mut ::c_void,
22-
pub aio_nbytes: ::size_t,
23-
pub aio_sigevent: ::sigevent,
24-
__next_prio: *mut aiocb,
25-
__abs_prio: ::c_int,
26-
__policy: ::c_int,
27-
__error_code: ::c_int,
28-
__return_value: ::ssize_t,
29-
pub aio_offset: off_t,
30-
__glibc_reserved: [::c_char; 32]
31-
}
32-
3317
pub struct stat {
3418
pub st_dev: ::c_ulong,
3519
st_pad1: [::c_long; 2],

src/unix/uclibc/mips/mod.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -150,31 +150,6 @@ pub const EOWNERDEAD: ::c_int = 165;
150150
pub const ENOTRECOVERABLE: ::c_int = 166;
151151
pub const ERFKILL: ::c_int = 167;
152152

153-
pub const LC_PAPER: ::c_int = 7;
154-
pub const LC_NAME: ::c_int = 8;
155-
pub const LC_ADDRESS: ::c_int = 9;
156-
pub const LC_TELEPHONE: ::c_int = 10;
157-
pub const LC_MEASUREMENT: ::c_int = 11;
158-
pub const LC_IDENTIFICATION: ::c_int = 12;
159-
pub const LC_PAPER_MASK: ::c_int = (1 << LC_PAPER);
160-
pub const LC_NAME_MASK: ::c_int = (1 << LC_NAME);
161-
pub const LC_ADDRESS_MASK: ::c_int = (1 << LC_ADDRESS);
162-
pub const LC_TELEPHONE_MASK: ::c_int = (1 << LC_TELEPHONE);
163-
pub const LC_MEASUREMENT_MASK: ::c_int = (1 << LC_MEASUREMENT);
164-
pub const LC_IDENTIFICATION_MASK: ::c_int = (1 << LC_IDENTIFICATION);
165-
pub const LC_ALL_MASK: ::c_int = ::LC_CTYPE_MASK
166-
| ::LC_NUMERIC_MASK
167-
| ::LC_TIME_MASK
168-
| ::LC_COLLATE_MASK
169-
| ::LC_MONETARY_MASK
170-
| ::LC_MESSAGES_MASK
171-
| LC_PAPER_MASK
172-
| LC_NAME_MASK
173-
| LC_ADDRESS_MASK
174-
| LC_TELEPHONE_MASK
175-
| LC_MEASUREMENT_MASK
176-
| LC_IDENTIFICATION_MASK;
177-
178153
pub const MAP_NORESERVE: ::c_int = 0x400;
179154
pub const MAP_ANON: ::c_int = 0x800;
180155
pub const MAP_ANONYMOUS: ::c_int = 0x800;

src/unix/uclibc/other/mod.rs

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,6 @@ pub type rlim_t = c_ulong;
44
pub type __priority_which_t = ::c_uint;
55

66
s! {
7-
pub struct aiocb {
8-
pub aio_fildes: ::c_int,
9-
pub aio_lio_opcode: ::c_int,
10-
pub aio_reqprio: ::c_int,
11-
pub aio_buf: *mut ::c_void,
12-
pub aio_nbytes: ::size_t,
13-
pub aio_sigevent: ::sigevent,
14-
__next_prio: *mut aiocb,
15-
__abs_prio: ::c_int,
16-
__policy: ::c_int,
17-
__error_code: ::c_int,
18-
__return_value: ::ssize_t,
19-
pub aio_offset: off_t,
20-
#[cfg(target_pointer_width = "32")]
21-
__unused1: [::c_char; 4],
22-
__glibc_reserved: [::c_char; 32]
23-
}
24-
257
pub struct __exit_status {
268
pub e_termination: ::c_short,
279
pub e_exit: ::c_short,
@@ -204,31 +186,6 @@ pub const SOL_NFC: ::c_int = 280;
204186

205187
pub const MSG_TRYHARD: ::c_int = 4;
206188

207-
pub const LC_PAPER: ::c_int = 7;
208-
pub const LC_NAME: ::c_int = 8;
209-
pub const LC_ADDRESS: ::c_int = 9;
210-
pub const LC_TELEPHONE: ::c_int = 10;
211-
pub const LC_MEASUREMENT: ::c_int = 11;
212-
pub const LC_IDENTIFICATION: ::c_int = 12;
213-
pub const LC_PAPER_MASK: ::c_int = (1 << LC_PAPER);
214-
pub const LC_NAME_MASK: ::c_int = (1 << LC_NAME);
215-
pub const LC_ADDRESS_MASK: ::c_int = (1 << LC_ADDRESS);
216-
pub const LC_TELEPHONE_MASK: ::c_int = (1 << LC_TELEPHONE);
217-
pub const LC_MEASUREMENT_MASK: ::c_int = (1 << LC_MEASUREMENT);
218-
pub const LC_IDENTIFICATION_MASK: ::c_int = (1 << LC_IDENTIFICATION);
219-
pub const LC_ALL_MASK: ::c_int = ::LC_CTYPE_MASK
220-
| ::LC_NUMERIC_MASK
221-
| ::LC_TIME_MASK
222-
| ::LC_COLLATE_MASK
223-
| ::LC_MONETARY_MASK
224-
| ::LC_MESSAGES_MASK
225-
| LC_PAPER_MASK
226-
| LC_NAME_MASK
227-
| LC_ADDRESS_MASK
228-
| LC_TELEPHONE_MASK
229-
| LC_MEASUREMENT_MASK
230-
| LC_IDENTIFICATION_MASK;
231-
232189
pub const MAP_ANON: ::c_int = 0x0020;
233190
pub const MAP_ANONYMOUS: ::c_int = 0x0020;
234191
pub const MAP_DENYWRITE: ::c_int = 0x0800;

src/unix/uclibc/s390x.rs

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,6 @@ pub type __fsword_t = ::c_long;
1818
pub type __priority_which_t = ::c_uint;
1919

2020
s! {
21-
pub struct aiocb {
22-
pub aio_fildes: ::c_int,
23-
pub aio_lio_opcode: ::c_int,
24-
pub aio_reqprio: ::c_int,
25-
pub aio_buf: *mut ::c_void,
26-
pub aio_nbytes: ::size_t,
27-
pub aio_sigevent: ::sigevent,
28-
__next_prio: *mut aiocb,
29-
__abs_prio: ::c_int,
30-
__policy: ::c_int,
31-
__error_code: ::c_int,
32-
__return_value: ::ssize_t,
33-
pub aio_offset: off_t,
34-
#[cfg(target_pointer_width = "32")]
35-
__unused1: [::c_char; 4],
36-
__glibc_reserved: [::c_char; 32]
37-
}
38-
3921
pub struct stat {
4022
pub st_dev: ::dev_t,
4123
pub st_ino: ::ino_t,
@@ -368,31 +350,6 @@ pub const O_NOFOLLOW: ::c_int = 0x20000;
368350

369351
pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK;
370352

371-
pub const LC_PAPER: ::c_int = 7;
372-
pub const LC_NAME: ::c_int = 8;
373-
pub const LC_ADDRESS: ::c_int = 9;
374-
pub const LC_TELEPHONE: ::c_int = 10;
375-
pub const LC_MEASUREMENT: ::c_int = 11;
376-
pub const LC_IDENTIFICATION: ::c_int = 12;
377-
pub const LC_PAPER_MASK: ::c_int = (1 << LC_PAPER);
378-
pub const LC_NAME_MASK: ::c_int = (1 << LC_NAME);
379-
pub const LC_ADDRESS_MASK: ::c_int = (1 << LC_ADDRESS);
380-
pub const LC_TELEPHONE_MASK: ::c_int = (1 << LC_TELEPHONE);
381-
pub const LC_MEASUREMENT_MASK: ::c_int = (1 << LC_MEASUREMENT);
382-
pub const LC_IDENTIFICATION_MASK: ::c_int = (1 << LC_IDENTIFICATION);
383-
pub const LC_ALL_MASK: ::c_int = ::LC_CTYPE_MASK
384-
| ::LC_NUMERIC_MASK
385-
| ::LC_TIME_MASK
386-
| ::LC_COLLATE_MASK
387-
| ::LC_MONETARY_MASK
388-
| ::LC_MESSAGES_MASK
389-
| LC_PAPER_MASK
390-
| LC_NAME_MASK
391-
| LC_ADDRESS_MASK
392-
| LC_TELEPHONE_MASK
393-
| LC_MEASUREMENT_MASK
394-
| LC_IDENTIFICATION_MASK;
395-
396353
pub const MAP_ANONYMOUS: ::c_int = 0x0020;
397354
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
398355
pub const MAP_DENYWRITE: ::c_int = 0x0800;

0 commit comments

Comments
 (0)