From 1366bda058e4dc757720a3b112752e593053bda1 Mon Sep 17 00:00:00 2001
From: Greg V <greg@unrelenting.technology>
Date: Sun, 29 Dec 2019 23:44:54 +0000
Subject: [PATCH] FreeBSD: make wchar_t unsigned on arm/aarch64

Wide chars are unsigned when normal chars are
---
 src/unix/bsd/apple/mod.rs                      | 1 +
 src/unix/bsd/freebsdlike/dragonfly/mod.rs      | 1 +
 src/unix/bsd/freebsdlike/freebsd/aarch64.rs    | 1 +
 src/unix/bsd/freebsdlike/freebsd/arm.rs        | 1 +
 src/unix/bsd/freebsdlike/freebsd/powerpc64.rs  | 1 +
 src/unix/bsd/freebsdlike/freebsd/x86.rs        | 1 +
 src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs | 1 +
 src/unix/bsd/mod.rs                            | 1 -
 src/unix/bsd/netbsdlike/mod.rs                 | 1 +
 9 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index c03c644e..f1309747 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -2,6 +2,7 @@
 //!
 //! This covers *-apple-* triples currently
 pub type c_char = i8;
+pub type wchar_t = i32;
 pub type clock_t = c_ulong;
 pub type time_t = c_long;
 pub type suseconds_t = i32;
diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
index b34cdb87..5841947f 100644
--- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs
+++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
@@ -1,5 +1,6 @@
 pub type dev_t = u32;
 pub type c_char = i8;
+pub type wchar_t = i32;
 pub type clock_t = u64;
 pub type ino_t = u64;
 pub type lwpid_t = i32;
diff --git a/src/unix/bsd/freebsdlike/freebsd/aarch64.rs b/src/unix/bsd/freebsdlike/freebsd/aarch64.rs
index 7138c86b..9a99ef0d 100644
--- a/src/unix/bsd/freebsdlike/freebsd/aarch64.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/aarch64.rs
@@ -1,6 +1,7 @@
 pub type c_char = u8;
 pub type c_long = i64;
 pub type c_ulong = u64;
+pub type wchar_t = u32;
 pub type time_t = i64;
 pub type suseconds_t = i64;
 
diff --git a/src/unix/bsd/freebsdlike/freebsd/arm.rs b/src/unix/bsd/freebsdlike/freebsd/arm.rs
index e49de8ad..1a0c7061 100644
--- a/src/unix/bsd/freebsdlike/freebsd/arm.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/arm.rs
@@ -1,6 +1,7 @@
 pub type c_char = u8;
 pub type c_long = i32;
 pub type c_ulong = u32;
+pub type wchar_t = u32;
 pub type time_t = i64;
 pub type suseconds_t = i32;
 
diff --git a/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs b/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs
index 39b38a56..1ac82687 100644
--- a/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs
@@ -1,6 +1,7 @@
 pub type c_char = u8;
 pub type c_long = i64;
 pub type c_ulong = u64;
+pub type wchar_t = i32;
 pub type time_t = i64;
 pub type suseconds_t = i64;
 
diff --git a/src/unix/bsd/freebsdlike/freebsd/x86.rs b/src/unix/bsd/freebsdlike/freebsd/x86.rs
index 8fee4344..a761e599 100644
--- a/src/unix/bsd/freebsdlike/freebsd/x86.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/x86.rs
@@ -1,6 +1,7 @@
 pub type c_char = i8;
 pub type c_long = i32;
 pub type c_ulong = u32;
+pub type wchar_t = i32;
 pub type time_t = i32;
 pub type suseconds_t = i32;
 
diff --git a/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs b/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs
index 6049c1a8..fea94a2c 100644
--- a/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs
@@ -1,6 +1,7 @@
 pub type c_char = i8;
 pub type c_long = i64;
 pub type c_ulong = u64;
+pub type wchar_t = i32;
 pub type time_t = i64;
 pub type suseconds_t = i64;
 
diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs
index a70c1d92..e90e4f7a 100644
--- a/src/unix/bsd/mod.rs
+++ b/src/unix/bsd/mod.rs
@@ -1,4 +1,3 @@
-pub type wchar_t = i32;
 pub type off_t = i64;
 pub type useconds_t = u32;
 pub type blkcnt_t = i64;
diff --git a/src/unix/bsd/netbsdlike/mod.rs b/src/unix/bsd/netbsdlike/mod.rs
index 976b95c2..a2a84077 100644
--- a/src/unix/bsd/netbsdlike/mod.rs
+++ b/src/unix/bsd/netbsdlike/mod.rs
@@ -1,3 +1,4 @@
+pub type wchar_t = i32;
 pub type time_t = i64;
 pub type mode_t = u32;
 pub type nlink_t = u32;
-- 
GitLab