Skip to content

Commit

Permalink
Merge pull request #553 from berkowski/fix_ppc
Browse files Browse the repository at this point in the history
Compile on all travis platforms
  • Loading branch information
Susurrus authored Apr 7, 2017
2 parents d82b535 + 3c5355d commit 67ae092
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
implementations).

### Fixed
- Fixed multiple issues compiling under different archetectures and OSes.
Now compiles on Linux/MIPS ([#538](https://github.com/nix-rust/nix/pull/538)),
`Linux/PPC` ([#553](https://github.com/nix-rust/nix/pull/553)),
`MacOS/x86_64,i686` ([#553](https://github.com/nix-rust/nix/pull/553),
and `NetBSD/x64_64` ([#538](https://github.com/nix-rust/nix/pull/538).
- Fixed multiple issues with Unix domain sockets on non-Linux OSes
([#474](https://github.com/nix-rust/nix/pull/415))
- Fixed using kqueue with `EVFILT_USER` on FreeBSD
Expand Down
16 changes: 12 additions & 4 deletions src/sys/socket/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ mod test {

#[cfg(target_os = "linux")]
#[test]
pub fn test_linux_consts() {
pub fn test_general_linux_consts() {
// TODO Figure out how to test new constants
check_const!(
SOL_IP,
Expand All @@ -434,13 +434,21 @@ mod test {
TCP_CORK,
// SO_BUSY_POLL,
// SO_RXQ_OVFL,
SO_PASSCRED,
SO_PRIORITY,
// SO_PROTOCOL,
SO_RCVBUFFORCE,
// SO_PEEK_OFF,
SO_PEERCRED,
SO_SNDBUFFORCE,
MSG_ERRQUEUE);
}

#[cfg(all(target_os = "linux", not(target_arch="arm")))]
#[test]
pub fn test_linux_not_arm_consts() {
// TODO Figure out how to test new constants
check_const!(
SO_PASSCRED,
SO_PEERCRED,
SO_SNDBUFFORCE);
}

}
2 changes: 1 addition & 1 deletion src/sys/socket/sockopt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ impl<'a> Set<'a, usize> for SetUsize {

#[cfg(test)]
mod test {
#[cfg(target_os = "linux")]
#[cfg(all(target_os = "linux", not(target_arch = "arm")))]
#[test]
fn can_get_peercred_on_unix_socket() {
use super::super::*;
Expand Down
10 changes: 10 additions & 0 deletions src/sys/syscall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ mod arch {
pub static MEMFD_CREATE: Syscall = 354;
}

#[cfg(target_arch = "powerpc")]
mod arch {
use libc::c_long;

pub type Syscall = c_long;

pub static SYSPIVOTROOT: Syscall = 203;
pub static MEMFD_CREATE: Syscall = 360;
}

extern {
pub fn syscall(num: Syscall, ...) -> c_int;
}
2 changes: 1 addition & 1 deletion src/sys/termios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ mod ffi {

use libc;

use libc::{c_int, c_uint, c_ulong, c_uchar};
use libc::c_int;

pub type tcflag_t = libc::tcflag_t;
pub type cc_t = libc::cc_t;
Expand Down

0 comments on commit 67ae092

Please sign in to comment.