From 1a42b17727a5736930e2ec4ef960ff9cb9dd0e4e Mon Sep 17 00:00:00 2001 From: evs-ch Date: Fri, 27 Nov 2020 05:41:04 +0100 Subject: [PATCH] Fixes building on aarch64 (#356) 827d94a seems to have broken building on aarch64. The fix is pretty much adapted from bf962c8. I know little about rust, so I might've missed some obvious issues with this PR - it seems to work so far, though. --- wezterm-font/src/fcwrap.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/wezterm-font/src/fcwrap.rs b/wezterm-font/src/fcwrap.rs index 742386f3a..f39b47b29 100644 --- a/wezterm-font/src/fcwrap.rs +++ b/wezterm-font/src/fcwrap.rs @@ -190,8 +190,11 @@ impl Pattern { pub fn add_charset(&mut self, charset: &CharSet) -> anyhow::Result<()> { unsafe { ensure!( - FcPatternAddCharSet(self.pat, b"charset\0".as_ptr() as *const i8, charset.cset) - != 0, + FcPatternAddCharSet( + self.pat, + b"charset\0".as_ptr() as *const c_char, + charset.cset + ) != 0, "failed to add charset property" ); Ok(()) @@ -201,7 +204,7 @@ impl Pattern { pub fn charset_intersect_count(&self, charset: &CharSet) -> anyhow::Result { unsafe { let mut c = ptr::null_mut(); - FcPatternGetCharSet(self.pat, b"charset\0".as_ptr() as *const i8, 0, &mut c); + FcPatternGetCharSet(self.pat, b"charset\0".as_ptr() as *const c_char, 0, &mut c); ensure!(!c.is_null(), "pattern has no charset"); Ok(FcCharSetIntersectCount(c, charset.cset)) } @@ -301,10 +304,10 @@ impl Pattern { // This defines the fields that are retrieved let oset = FcObjectSetCreate(); ensure!(!oset.is_null(), "FcObjectSetCreate failed"); - FcObjectSetAdd(oset, b"family\0".as_ptr() as *const i8); - FcObjectSetAdd(oset, b"file\0".as_ptr() as *const i8); - FcObjectSetAdd(oset, b"index\0".as_ptr() as *const i8); - FcObjectSetAdd(oset, b"charset\0".as_ptr() as *const i8); + FcObjectSetAdd(oset, b"family\0".as_ptr() as *const c_char); + FcObjectSetAdd(oset, b"file\0".as_ptr() as *const c_char); + FcObjectSetAdd(oset, b"index\0".as_ptr() as *const c_char); + FcObjectSetAdd(oset, b"charset\0".as_ptr() as *const c_char); let fonts = FcFontList(ptr::null_mut(), self.pat, oset); let result = if !fonts.is_null() {