Skip to content

Commit 2cff15e

Browse files
committed
Auto merge of #870 - semarie:openbsd-aarch64, r=alexcrichton
Openbsd aarch64 it adds aarch64-unknown-openbsd definition (and push `c_char` deeper, so the amount of changes). I also updated errno definitions for openbsd
2 parents 385a822 + 94827af commit 2cff15e

File tree

13 files changed

+46
-16
lines changed

13 files changed

+46
-16
lines changed

src/unix/bsd/apple/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//!
33
//! This covers *-apple-* triples currently
44
5+
pub type c_char = i8;
56
pub type clock_t = c_ulong;
67
pub type time_t = c_long;
78
pub type suseconds_t = i32;

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
pub type c_char = i8;
12
pub type dev_t = u32;
23
pub type mode_t = u16;
34
pub type pthread_attr_t = *mut ::c_void;

src/unix/bsd/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use dox::{mem, Option};
22

3-
pub type c_char = i8;
43
pub type wchar_t = i32;
54
pub type off_t = i64;
65
pub type useconds_t = u32;

src/unix/bsd/netbsdlike/netbsd/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use dox::mem;
22

3+
pub type c_char = i8;
34
pub type clock_t = ::c_uint;
45
pub type suseconds_t = ::c_int;
56
pub type dev_t = u64;

src/unix/bsd/netbsdlike/openbsdlike/bitrig.rs renamed to src/unix/bsd/netbsdlike/openbsdlike/bitrig/mod.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
pub type c_char = i8;
2+
13
s! {
24
pub struct lconv {
35
pub decimal_point: *mut ::c_char,
@@ -73,3 +75,15 @@ extern {
7375
pub fn uselocale(loc: ::locale_t) -> ::locale_t;
7476
pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char;
7577
}
78+
79+
cfg_if! {
80+
if #[cfg(target_arch = "x86")] {
81+
mod x86;
82+
pub use self::x86::*;
83+
} else if #[cfg(target_arch = "x86_64")] {
84+
mod x86_64;
85+
pub use self::x86_64::*;
86+
} else {
87+
// Unknown target_arch
88+
}
89+
}

src/unix/bsd/netbsdlike/openbsdlike/mod.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,11 @@ pub const ECANCELED : ::c_int = 88;
211211
pub const EIDRM : ::c_int = 89;
212212
pub const ENOMSG : ::c_int = 90;
213213
pub const ENOTSUP : ::c_int = 91;
214-
pub const ELAST : ::c_int = 91;
214+
pub const EBADMSG : ::c_int = 92;
215+
pub const ENOTRECOVERABLE : ::c_int = 93;
216+
pub const EOWNERDEAD : ::c_int = 94;
217+
pub const EPROTO : ::c_int = 95;
218+
pub const ELAST : ::c_int = 95;
215219

216220
pub const F_DUPFD_CLOEXEC : ::c_int = 10;
217221

@@ -744,6 +748,3 @@ cfg_if! {
744748
// Unknown target_os
745749
}
746750
}
747-
748-
mod other;
749-
pub use self::other::*;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pub type c_long = i64;
2+
pub type c_ulong = u64;
3+
pub type c_char = u8;

src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs renamed to src/unix/bsd/netbsdlike/openbsdlike/openbsd/mod.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,18 @@ extern {
3333
pub fn execvpe(file: *const ::c_char, argv: *const *const ::c_char,
3434
envp: *const *const ::c_char) -> ::c_int;
3535
}
36+
37+
cfg_if! {
38+
if #[cfg(target_arch = "x86")] {
39+
mod x86;
40+
pub use self::x86::*;
41+
} else if #[cfg(target_arch = "x86_64")] {
42+
mod x86_64;
43+
pub use self::x86_64::*;
44+
} else if #[cfg(target_arch = "aarch64")] {
45+
mod aarch64;
46+
pub use self::aarch64::*;
47+
} else {
48+
// Unknown target_arch
49+
}
50+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pub type c_long = i32;
2+
pub type c_ulong = u32;
3+
pub type c_char = i8;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pub type c_long = i64;
2+
pub type c_ulong = u64;
3+
pub type c_char = i8;

src/unix/bsd/netbsdlike/openbsdlike/other/mod.rs

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

0 commit comments

Comments
 (0)