1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 23:21:08 +03:00

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.
This commit is contained in:
evs-ch 2020-11-27 05:41:04 +01:00 committed by GitHub
parent 214390ba5a
commit 1a42b17727
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<u32> {
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() {