Prospective build fix for arm cross build

Use the `c_char` type that adapts to the signedness
This commit is contained in:
Simon Hausmann 2022-12-06 09:07:48 +01:00
parent 71199fbb16
commit 000d95670b

View file

@ -18,7 +18,7 @@ pub fn find_families(requested_family: &str) -> Vec<String> {
feature = "fontconfig-dlopen",
LIB,
FcNameParse,
family_cstr.as_ptr() as *mut u8
family_cstr.as_ptr() as *mut core::ffi::c_char
);
ffi_dispatch!(
feature = "fontconfig-dlopen",
@ -49,7 +49,7 @@ pub fn find_families(requested_family: &str) -> Vec<String> {
LIB,
FcPatternGetString,
*(*result_set).fonts.offset(idx as isize),
b"family\0".as_ptr() as *const i8,
b"family\0".as_ptr() as *const core::ffi::c_char,
0,
&mut raw_family_name
) != ffi::FcResultMatch
@ -60,10 +60,11 @@ pub fn find_families(requested_family: &str) -> Vec<String> {
if raw_family_name.is_null() {
continue;
}
if let Some(family_name) = std::ffi::CStr::from_ptr(raw_family_name as *const i8)
.to_str()
.ok()
.map(|raw_family_name| raw_family_name.to_owned())
if let Some(family_name) =
std::ffi::CStr::from_ptr(raw_family_name as *const core::ffi::c_char)
.to_str()
.ok()
.map(|raw_family_name| raw_family_name.to_owned())
{
families.push(family_name)
}