Skip to content

Commit abcc6ab

Browse files
Move arch specific defines down into arch modules
1 parent 78c1aa0 commit abcc6ab

File tree

6 files changed

+70
-38
lines changed

6 files changed

+70
-38
lines changed

src/unix/notbsd/linux/other/b32/arm.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,17 @@ pub type wchar_t = u32;
44
pub const O_DIRECT: ::c_int = 0x10000;
55
pub const O_DIRECTORY: ::c_int = 0x4000;
66
pub const O_NOFOLLOW: ::c_int = 0x8000;
7+
8+
pub const MAP_LOCKED: ::c_int = 0x02000;
9+
pub const MAP_NORESERVE: ::c_int = 0x04000;
10+
11+
pub const EDEADLK: ::c_int = 35;
12+
13+
pub const SO_PEERCRED: ::c_int = 17;
14+
pub const SO_RCVLOWAT: ::c_int = 18;
15+
pub const SO_SNDLOWAT: ::c_int = 19;
16+
pub const SO_RCVTIMEO: ::c_int = 20;
17+
pub const SO_SNDTIMEO: ::c_int = 21;
18+
19+
pub const FIOCLEX: ::c_ulong = 0x5451;
20+
pub const FIONBIO: ::c_ulong = 0x5421;

src/unix/notbsd/linux/other/b32/x86.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,17 @@ pub type wchar_t = i32;
44
pub const O_DIRECT: ::c_int = 0x4000;
55
pub const O_DIRECTORY: ::c_int = 0x10000;
66
pub const O_NOFOLLOW: ::c_int = 0x20000;
7+
8+
pub const MAP_LOCKED: ::c_int = 0x02000;
9+
pub const MAP_NORESERVE: ::c_int = 0x04000;
10+
11+
pub const EDEADLK: ::c_int = 35;
12+
13+
pub const SO_PEERCRED: ::c_int = 17;
14+
pub const SO_RCVLOWAT: ::c_int = 18;
15+
pub const SO_SNDLOWAT: ::c_int = 19;
16+
pub const SO_RCVTIMEO: ::c_int = 20;
17+
pub const SO_SNDTIMEO: ::c_int = 21;
18+
19+
pub const FIOCLEX: ::c_ulong = 0x5451;
20+
pub const FIONBIO: ::c_ulong = 0x5421;

src/unix/notbsd/linux/other/b64/aarch64.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@ pub const O_DIRECT: ::c_int = 0x10000;
1212
pub const O_DIRECTORY: ::c_int = 0x4000;
1313
pub const O_NOFOLLOW: ::c_int = 0x8000;
1414

15+
pub const MAP_LOCKED: ::c_int = 0x02000;
16+
pub const MAP_NORESERVE: ::c_int = 0x04000;
17+
18+
pub const EDEADLK: ::c_int = 35;
19+
20+
pub const SO_PEERCRED: ::c_int = 17;
21+
pub const SO_RCVLOWAT: ::c_int = 18;
22+
pub const SO_SNDLOWAT: ::c_int = 19;
23+
pub const SO_RCVTIMEO: ::c_int = 20;
24+
pub const SO_SNDTIMEO: ::c_int = 21;
25+
26+
pub const FIOCLEX: ::c_ulong = 0x5451;
27+
pub const FIONBIO: ::c_ulong = 0x5421;
28+
1529
s! {
1630
pub struct stat {
1731
pub st_dev: ::dev_t,

src/unix/notbsd/linux/other/b64/powerpc64.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@ pub const O_DIRECTORY: ::c_int = 0x4000;
1212
pub const O_NOFOLLOW: ::c_int = 0x8000;
1313
pub const O_DIRECT: ::c_int = 0x20000;
1414

15+
pub const MAP_LOCKED: ::c_int = 0x00080;
16+
pub const MAP_NORESERVE: ::c_int = 0x00040;
17+
18+
pub const EDEADLK: ::c_int = 58;
19+
20+
pub const SO_PEERCRED: ::c_int = 21;
21+
pub const SO_RCVLOWAT: ::c_int = 16;
22+
pub const SO_SNDLOWAT: ::c_int = 17;
23+
pub const SO_RCVTIMEO: ::c_int = 18;
24+
pub const SO_SNDTIMEO: ::c_int = 19;
25+
26+
pub const FIOCLEX: ::c_ulong = 0x20006601;
27+
pub const FIONBIO: ::c_ulong = 0x8004667e;
28+
1529
s! {
1630
pub struct stat {
1731
pub st_dev: ::dev_t,

src/unix/notbsd/linux/other/b64/x86_64.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@ pub const O_DIRECT: ::c_int = 0x4000;
1212
pub const O_DIRECTORY: ::c_int = 0x10000;
1313
pub const O_NOFOLLOW: ::c_int = 0x20000;
1414

15+
pub const MAP_LOCKED: ::c_int = 0x02000;
16+
pub const MAP_NORESERVE: ::c_int = 0x04000;
17+
18+
pub const EDEADLK: ::c_int = 35;
19+
20+
pub const SO_PEERCRED: ::c_int = 17;
21+
pub const SO_RCVLOWAT: ::c_int = 18;
22+
pub const SO_SNDLOWAT: ::c_int = 19;
23+
pub const SO_RCVTIMEO: ::c_int = 20;
24+
pub const SO_SNDTIMEO: ::c_int = 21;
25+
26+
pub const FIOCLEX: ::c_ulong = 0x5451;
27+
pub const FIONBIO: ::c_ulong = 0x5421;
28+
1529
pub const PTRACE_GETFPREGS: ::c_uint = 14;
1630
pub const PTRACE_SETFPREGS: ::c_uint = 15;
1731
pub const PTRACE_GETFPXREGS: ::c_uint = 18;

src/unix/notbsd/linux/other/mod.rs

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -110,23 +110,10 @@ pub const MAP_ANONYMOUS: ::c_int = 0x0020;
110110
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
111111
pub const MAP_DENYWRITE: ::c_int = 0x0800;
112112
pub const MAP_EXECUTABLE: ::c_int = 0x01000;
113-
cfg_if! {
114-
if #[cfg(any(target_arch = "powerpc64", target_arch = "powerpc64le"))] {
115-
pub const MAP_LOCKED: ::c_int = 0x00080;
116-
pub const MAP_NORESERVE: ::c_int = 0x00040;
117-
} else {
118-
pub const MAP_LOCKED: ::c_int = 0x02000;
119-
pub const MAP_NORESERVE: ::c_int = 0x04000;
120-
}
121-
}
122113
pub const MAP_POPULATE: ::c_int = 0x08000;
123114
pub const MAP_NONBLOCK: ::c_int = 0x010000;
124115
pub const MAP_STACK: ::c_int = 0x020000;
125116

126-
#[cfg(any(target_arch = "powerpc64", target_arch = "powerpc64le"))]
127-
pub const EDEADLK: ::c_int = 58;
128-
#[cfg(not(any(target_arch = "powerpc64", target_arch = "powerpc64le")))]
129-
pub const EDEADLK: ::c_int = 35;
130117
pub const ENAMETOOLONG: ::c_int = 36;
131118
pub const ENOLCK: ::c_int = 37;
132119
pub const ENOSYS: ::c_int = 38;
@@ -227,21 +214,6 @@ pub const SO_KEEPALIVE: ::c_int = 9;
227214
pub const SO_OOBINLINE: ::c_int = 10;
228215
pub const SO_LINGER: ::c_int = 13;
229216
pub const SO_REUSEPORT: ::c_int = 15;
230-
cfg_if! {
231-
if #[cfg(any(target_arch = "powerpc64", target_arch = "powerpc64le"))] {
232-
pub const SO_PEERCRED: ::c_int = 21;
233-
pub const SO_RCVLOWAT: ::c_int = 16;
234-
pub const SO_SNDLOWAT: ::c_int = 17;
235-
pub const SO_RCVTIMEO: ::c_int = 18;
236-
pub const SO_SNDTIMEO: ::c_int = 19;
237-
} else {
238-
pub const SO_PEERCRED: ::c_int = 17;
239-
pub const SO_RCVLOWAT: ::c_int = 18;
240-
pub const SO_SNDLOWAT: ::c_int = 19;
241-
pub const SO_RCVTIMEO: ::c_int = 20;
242-
pub const SO_SNDTIMEO: ::c_int = 21;
243-
}
244-
}
245217
pub const SO_ACCEPTCONN: ::c_int = 30;
246218

247219
pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15;
@@ -287,16 +259,6 @@ pub const SIG_UNBLOCK: ::c_int = 0x01;
287259
pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01;
288260
pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02;
289261

290-
cfg_if! {
291-
if #[cfg(any(target_arch = "powerpc64", target_arch = "powerpc64le"))] {
292-
pub const FIOCLEX: ::c_ulong = 0x20006601;
293-
pub const FIONBIO: ::c_ulong = 0x8004667e;
294-
} else {
295-
pub const FIOCLEX: ::c_ulong = 0x5451;
296-
pub const FIONBIO: ::c_ulong = 0x5421;
297-
}
298-
}
299-
300262
pub const BUFSIZ: ::c_uint = 8192;
301263
pub const TMP_MAX: ::c_uint = 238328;
302264
pub const FOPEN_MAX: ::c_uint = 16;

0 commit comments

Comments
 (0)