Merge branch 'voice_type' into 'master'

Fix voice_type signedness change

Closes #4

See merge request ndarilek/speech-dispatcher-rs!6
This commit is contained in:
Nolan Darilek 2022-09-07 14:48:56 +00:00
commit e770c73e67
3 changed files with 12 additions and 12 deletions

View File

@ -11,7 +11,7 @@ before_script:
test:
stage: test
script:
- cargo test
- cargo test --no-default-features --features 0_10
publish:
stage: publish

View File

@ -8,9 +8,9 @@ license = "LGPL-2.1 OR MIT OR Apache-2.0"
edition = "2021"
[features]
0_10_2 = ["0_10"]
0_11 = ["0_10"]
0_10 = []
default = ["0_10_2"]
default = ["0_11"]
[dependencies]
lazy_static = "1"

View File

@ -413,26 +413,26 @@ impl Connection {
}
pub fn set_voice_type(&self, voice_type: VoiceType) -> Result<(), Error> {
#[cfg(all(feature = "0_10", not(feature = "0_10_2")))]
let v = unsafe { spd_set_voice_type(*self.0, voice_type as i32) };
#[cfg(any(feature = "0_10_2", not(feature = "0_10")))]
#[cfg(all(feature = "0_10", not(feature = "0_11")))]
let v = unsafe { spd_set_voice_type(*self.0, voice_type as u32) };
#[cfg(any(feature = "0_11", not(feature = "0_10")))]
let v = unsafe { spd_set_voice_type(*self.0, voice_type as i32) };
c_int_to_result(v)
}
pub fn set_voice_type_all(&self, voice_type: VoiceType) -> Result<(), Error> {
#[cfg(all(feature = "0_10", not(feature = "0_10_2")))]
let v = unsafe { spd_set_voice_type_all(*self.0, voice_type as i32) };
#[cfg(any(feature = "0_10_2", not(feature = "0_10")))]
#[cfg(all(feature = "0_10", not(feature = "0_11")))]
let v = unsafe { spd_set_voice_type_all(*self.0, voice_type as u32) };
#[cfg(any(feature = "0_11", not(feature = "0_10")))]
let v = unsafe { spd_set_voice_type_all(*self.0, voice_type as i32) };
c_int_to_result(v)
}
pub fn set_voice_type_uid(&self, voice_type: VoiceType, target_uid: u32) -> Result<(), Error> {
#[cfg(all(feature = "0_10", not(feature = "0_10_2")))]
let v = unsafe { spd_set_voice_type_uid(*self.0, voice_type as i32, target_uid) };
#[cfg(any(feature = "0_10_2", not(feature = "0_10")))]
#[cfg(all(feature = "0_10", not(feature = "0_11")))]
let v = unsafe { spd_set_voice_type_uid(*self.0, voice_type as u32, target_uid) };
#[cfg(any(feature = "0_11", not(feature = "0_10")))]
let v = unsafe { spd_set_voice_type_uid(*self.0, voice_type as i32, target_uid) };
c_int_to_result(v)
}