Cast the bool to i8 for Apple Silicon

This commit is contained in:
Oskar Thornblad 2021-01-26 22:37:53 +01:00
parent 42879dfa1f
commit abd97ebf73
1 changed files with 12 additions and 0 deletions

View File

@ -196,6 +196,18 @@ impl Backend for AppKit {
Ok(())
}
#[cfg(target_arch = "aarch64")]
fn is_speaking(&self) -> Result<bool, Error> {
let is_speaking: i8 = unsafe { msg_send![self.0, isSpeaking] };
Ok(is_speaking == YES as i8)
}
#[cfg(target_arch = "x86")]
#[cfg(target_arch = "x86_64")]
#[cfg(target_arch = "mips")]
#[cfg(target_arch = "powerpc")]
#[cfg(target_arch = "powerpc64")]
#[cfg(target_arch = "arm")]
fn is_speaking(&self) -> Result<bool, Error> {
let is_speaking: i8 = unsafe { msg_send![self.0, isSpeaking] };
Ok(is_speaking == YES)