From 00648e11c770a6bc5186263cd7d33228da8da165 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Marie?= <semarie@users.noreply.github.com>
Date: Mon, 28 Nov 2016 12:05:13 +0100
Subject: [PATCH] Make openbsdlike to support 64 and 32 bits archs

---
 src/unix/bsd/netbsdlike/openbsdlike/mod.rs           |  5 +++--
 src/unix/bsd/netbsdlike/openbsdlike/other/b32/mod.rs |  2 ++
 src/unix/bsd/netbsdlike/openbsdlike/other/b64/mod.rs |  2 ++
 src/unix/bsd/netbsdlike/openbsdlike/other/mod.rs     | 11 +++++++++++
 4 files changed, 18 insertions(+), 2 deletions(-)
 create mode 100644 src/unix/bsd/netbsdlike/openbsdlike/other/b32/mod.rs
 create mode 100644 src/unix/bsd/netbsdlike/openbsdlike/other/b64/mod.rs
 create mode 100644 src/unix/bsd/netbsdlike/openbsdlike/other/mod.rs

diff --git a/src/unix/bsd/netbsdlike/openbsdlike/mod.rs b/src/unix/bsd/netbsdlike/openbsdlike/mod.rs
index 10e8527d..4e6019ba 100644
--- a/src/unix/bsd/netbsdlike/openbsdlike/mod.rs
+++ b/src/unix/bsd/netbsdlike/openbsdlike/mod.rs
@@ -1,5 +1,3 @@
-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;
@@ -448,3 +446,6 @@ cfg_if! {
         // Unknown target_os
     }
 }
+
+mod other;
+pub use self::other::*;
diff --git a/src/unix/bsd/netbsdlike/openbsdlike/other/b32/mod.rs b/src/unix/bsd/netbsdlike/openbsdlike/other/b32/mod.rs
new file mode 100644
index 00000000..9b0b338b
--- /dev/null
+++ b/src/unix/bsd/netbsdlike/openbsdlike/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/openbsdlike/other/b64/mod.rs b/src/unix/bsd/netbsdlike/openbsdlike/other/b64/mod.rs
new file mode 100644
index 00000000..b07c476a
--- /dev/null
+++ b/src/unix/bsd/netbsdlike/openbsdlike/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/openbsdlike/other/mod.rs b/src/unix/bsd/netbsdlike/openbsdlike/other/mod.rs
new file mode 100644
index 00000000..e4087da7
--- /dev/null
+++ b/src/unix/bsd/netbsdlike/openbsdlike/other/mod.rs
@@ -0,0 +1,11 @@
+cfg_if! {
+    if #[cfg(target_arch = "x86_64")] {
+        mod b64;
+        pub use self::b64::*;
+    } else if #[cfg(target_arch = "x86")] {
+        mod b32;
+        pub use self::b32::*;
+    } else {
+        // Unknown target_arch
+    }
+}
-- 
GitLab