summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-09-30 10:36:43 -0700
committerGitHub <noreply@github.com>2016-09-30 10:36:43 -0700
commitfd06ed736197300a974011c669e8ff8a816fcfac (patch)
tree304e2bc05eb9b83b78e7290d491de58bd7004856
parent0e0ab04abe1da61e42e58fa6f9b15ca1cc5c3f56 (diff)
parent07a0190be97c010f3b3f628b83ad8e93e0bc77b0 (diff)
downloadrust-libc-fd06ed736197300a974011c669e8ff8a816fcfac.tar.gz
Auto merge of #409 - jakllsch:netbsdlike-long-fixes, r=alexcrichton
Use correct type for c_ulong and c_long on 32-bit netbsdlike
-rw-r--r--src/unix/bsd/netbsdlike/mod.rs2
-rw-r--r--src/unix/bsd/netbsdlike/netbsd/mod.rs (renamed from src/unix/bsd/netbsdlike/netbsd.rs)3
-rw-r--r--src/unix/bsd/netbsdlike/netbsd/other/b32/mod.rs2
-rw-r--r--src/unix/bsd/netbsdlike/netbsd/other/b64/mod.rs2
-rw-r--r--src/unix/bsd/netbsdlike/netbsd/other/mod.rs13
-rw-r--r--src/unix/bsd/netbsdlike/openbsdlike/mod.rs2
6 files changed, 22 insertions, 2 deletions
diff --git a/src/unix/bsd/netbsdlike/mod.rs b/src/unix/bsd/netbsdlike/mod.rs
index 9c5aef9db8..bcdb8931c5 100644
--- a/src/unix/bsd/netbsdlike/mod.rs
+++ b/src/unix/bsd/netbsdlike/mod.rs
@@ -1,5 +1,3 @@
-pub type c_long = i64;
-pub type c_ulong = u64;
pub type time_t = i64;
pub type mode_t = u32;
pub type nlink_t = ::uint32_t;
diff --git a/src/unix/bsd/netbsdlike/netbsd.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs
index c4e711db83..aa46aff191 100644
--- a/src/unix/bsd/netbsdlike/netbsd.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -613,3 +613,6 @@ extern {
locale: *const ::c_char,
base: ::locale_t) -> ::locale_t;
}
+
+mod other;
+pub use self::other::*;
diff --git a/src/unix/bsd/netbsdlike/netbsd/other/b32/mod.rs b/src/unix/bsd/netbsdlike/netbsd/other/b32/mod.rs
new file mode 100644
index 0000000000..9b0b338b91
--- /dev/null
+++ b/src/unix/bsd/netbsdlike/netbsd/other/b32/mod.rs
@@ -0,0 +1,2 @@
+pub type c_long = i32;
+pub type c_ulong = u32;
diff --git a/src/unix/bsd/netbsdlike/netbsd/other/b64/mod.rs b/src/unix/bsd/netbsdlike/netbsd/other/b64/mod.rs
new file mode 100644
index 0000000000..b07c476aa4
--- /dev/null
+++ b/src/unix/bsd/netbsdlike/netbsd/other/b64/mod.rs
@@ -0,0 +1,2 @@
+pub type c_long = i64;
+pub type c_ulong = u64;
diff --git a/src/unix/bsd/netbsdlike/netbsd/other/mod.rs b/src/unix/bsd/netbsdlike/netbsd/other/mod.rs
new file mode 100644
index 0000000000..f4e7cc4061
--- /dev/null
+++ b/src/unix/bsd/netbsdlike/netbsd/other/mod.rs
@@ -0,0 +1,13 @@
+cfg_if! {
+ if #[cfg(target_arch = "x86_64")] {
+ mod b64;
+ pub use self::b64::*;
+ } else if #[cfg(any(target_arch = "arm",
+ target_arch = "powerpc",
+ target_arch = "x86"))] {
+ mod b32;
+ pub use self::b32::*;
+ } else {
+ // Unknown target_arch
+ }
+}
diff --git a/src/unix/bsd/netbsdlike/openbsdlike/mod.rs b/src/unix/bsd/netbsdlike/openbsdlike/mod.rs
index 4d35822fbe..d7afb11edd 100644
--- a/src/unix/bsd/netbsdlike/openbsdlike/mod.rs
+++ b/src/unix/bsd/netbsdlike/openbsdlike/mod.rs
@@ -1,3 +1,5 @@
+pub type c_long = i64;
+pub type c_ulong = u64;
pub type clock_t = i64;
pub type suseconds_t = i64;
pub type dev_t = i32;