Skip to content

Commit

Permalink
NetBSD: correct c_char signedness on arm and powerpc
Browse files Browse the repository at this point in the history
  • Loading branch information
jakllsch committed Aug 6, 2018
1 parent 6bdbf5d commit 174888f
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pub type c_long = i32;
pub type c_ulong = u32;
pub type c_char = u8;
23 changes: 20 additions & 3 deletions src/unix/bsd/netbsdlike/netbsd/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use dox::mem;

pub type c_char = i8;
pub type clock_t = ::c_uint;
pub type suseconds_t = ::c_int;
pub type dev_t = u64;
Expand Down Expand Up @@ -1110,5 +1109,23 @@ extern {
result: *mut *mut ::group) -> ::c_int;
}

mod other;
pub use self::other::*;
cfg_if! {
if #[cfg(target_arch = "arm")]
mod arm;
pub use self::arm::*;
} else if #[cfg(target_arch = "powerpc")] {
mod powerpc;
pub use self::powerpc::*;
} else if #[cfg(target_arch = "sparc64")] {
mod sparc64;
pub use self::sparc64::*;
} else if #[cfg(target_arch = "x86_64")] {
mod x86_64;
pub use self::x86_64::*;
} else if #[cfg(target_arch = "x86")] {
mod x86;
pub use self::x86::*;
} else {
// Unknown target_arch
}
}
14 changes: 0 additions & 14 deletions src/unix/bsd/netbsdlike/netbsd/other/mod.rs

This file was deleted.

3 changes: 3 additions & 0 deletions src/unix/bsd/netbsdlike/netbsd/powerpc.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub type c_long = i32;
pub type c_ulong = u32;
pub type c_char = u8;
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = i8;
3 changes: 3 additions & 0 deletions src/unix/bsd/netbsdlike/netbsd/x86.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub type c_long = i32;
pub type c_ulong = u32;
pub type c_char = i8;
3 changes: 3 additions & 0 deletions src/unix/bsd/netbsdlike/netbsd/x86_64.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = i8;

0 comments on commit 174888f

Please sign in to comment.