From 3ecde5a2d30ae623d97449f3ee29844dbedbf6a5 Mon Sep 17 00:00:00 2001 From: Yury Date: Tue, 29 Oct 2024 19:51:32 +0300 Subject: [PATCH] Tune core_audio feature flags --- cidre/src/core_audio.rs | 2 ++ cidre/src/core_audio/hardware.rs | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cidre/src/core_audio.rs b/cidre/src/core_audio.rs index a630dfb5..4deac205 100644 --- a/cidre/src/core_audio.rs +++ b/cidre/src/core_audio.rs @@ -2,5 +2,7 @@ mod hardware_base; pub use hardware_base::*; mod hardware; + +#[cfg(all(feature = "blocks", feature = "dispatch"))] pub use hardware::AudioObjPropListenerBlock; pub use hardware::AudioObjPropListenerFn; diff --git a/cidre/src/core_audio/hardware.rs b/cidre/src/core_audio/hardware.rs index 5cce6f15..966baf31 100644 --- a/cidre/src/core_audio/hardware.rs +++ b/cidre/src/core_audio/hardware.rs @@ -1,6 +1,9 @@ use std::ffi::c_void; -use crate::{arc, at::AudioBufListN, blocks, cf, core_audio, dispatch, os}; +use crate::{arc, at::AudioBufListN, cf, core_audio, os}; + +#[cfg(all(feature = "blocks", feature = "dispatch"))] +use crate::{blocks, dispatch}; use super::{ AudioObjId, AudioObjPropAddr, AudioObjPropElement, AudioObjPropScope, AudioObjPropSelector, @@ -15,6 +18,7 @@ pub type AudioObjPropListenerFn = extern "C-unwind" fn( ) -> os::Status; #[doc(alias = "AudioObjectPropertyListenerBlock")] +#[cfg(all(feature = "blocks", feature = "dispatch"))] pub type AudioObjPropListenerBlock = blocks::EscBlock; @@ -223,6 +227,7 @@ impl core_audio::AudioObjId { } #[doc(alias = "AudioObjectAddPropertyListenerBlock")] + #[cfg(all(feature = "blocks", feature = "dispatch"))] pub fn add_prop_listener_block( &self, address: &AudioObjPropAddr, @@ -235,6 +240,7 @@ impl core_audio::AudioObjId { } #[doc(alias = "AudioObjectRemovePropertyListenerBlock")] + #[cfg(all(feature = "blocks", feature = "dispatch"))] pub fn remove_prop_listener_block( &self, address: &AudioObjPropAddr, @@ -828,6 +834,7 @@ extern "C-unwind" { client_data: *mut c_void, ) -> os::Status; + #[cfg(all(feature = "blocks", feature = "dispatch"))] fn AudioObjectAddPropertyListenerBlock( objectId: AudioObjId, address: *const AudioObjPropAddr, @@ -835,6 +842,7 @@ extern "C-unwind" { listener: *mut AudioObjPropListenerBlock, ) -> os::Status; + #[cfg(all(feature = "blocks", feature = "dispatch"))] fn AudioObjectRemovePropertyListenerBlock( objectId: AudioObjId, address: *const AudioObjPropAddr,