Skip to content

Commit 174888f

Browse files
committed
NetBSD: correct c_char signedness on arm and powerpc
1 parent 6bdbf5d commit 174888f

File tree

7 files changed

+31
-17
lines changed

7 files changed

+31
-17
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
pub type c_long = i32;
22
pub type c_ulong = u32;
3+
pub type c_char = u8;

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

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

3-
pub type c_char = i8;
43
pub type clock_t = ::c_uint;
54
pub type suseconds_t = ::c_int;
65
pub type dev_t = u64;
@@ -1110,5 +1109,23 @@ extern {
11101109
result: *mut *mut ::group) -> ::c_int;
11111110
}
11121111

1113-
mod other;
1114-
pub use self::other::*;
1112+
cfg_if! {
1113+
if #[cfg(target_arch = "arm")]
1114+
mod arm;
1115+
pub use self::arm::*;
1116+
} else if #[cfg(target_arch = "powerpc")] {
1117+
mod powerpc;
1118+
pub use self::powerpc::*;
1119+
} else if #[cfg(target_arch = "sparc64")] {
1120+
mod sparc64;
1121+
pub use self::sparc64::*;
1122+
} else if #[cfg(target_arch = "x86_64")] {
1123+
mod x86_64;
1124+
pub use self::x86_64::*;
1125+
} else if #[cfg(target_arch = "x86")] {
1126+
mod x86;
1127+
pub use self::x86::*;
1128+
} else {
1129+
// Unknown target_arch
1130+
}
1131+
}

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

Lines changed: 0 additions & 14 deletions
This file was deleted.
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 = u8;
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
pub type c_long = i64;
22
pub type c_ulong = u64;
3+
pub type c_char = i8;

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

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;

0 commit comments

Comments
 (0)