mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Amend conditional compilation to fail on unsupported systems
This commit is contained in:
parent
aad4dba8a8
commit
59f87dcb37
2 changed files with 22 additions and 4 deletions
|
@ -34,7 +34,16 @@ mod jackaudio;
|
|||
#[cfg(feature = "jackaudio-backend")]
|
||||
use self::jackaudio::JackSink;
|
||||
|
||||
#[cfg(feature = "rodiojack-backend")]
|
||||
#[cfg(all(
|
||||
feature = "rodiojack-backend",
|
||||
not(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd"))
|
||||
))]
|
||||
compile_error!("Rodio JACK backend is currently only supported on linux.");
|
||||
|
||||
#[cfg(all(
|
||||
feature = "rodiojack-backend",
|
||||
any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd")
|
||||
))]
|
||||
use self::rodio::JackRodioSink;
|
||||
|
||||
#[cfg(feature = "gstreamer-backend")]
|
||||
|
|
|
@ -12,7 +12,10 @@ pub struct RodioSink {
|
|||
stream: rodio::OutputStream,
|
||||
}
|
||||
|
||||
#[cfg(feature = "rodiojack-backend")]
|
||||
#[cfg(all(
|
||||
feature = "rodiojack-backend",
|
||||
any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd")
|
||||
))]
|
||||
pub struct JackRodioSink {
|
||||
jackrodio_sink: rodio::Sink,
|
||||
// We have to keep hold of this object, or the Sink can't play...
|
||||
|
@ -117,7 +120,10 @@ impl Open for RodioSink {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "rodiojack-backend")]
|
||||
#[cfg(all(
|
||||
feature = "rodiojack-backend",
|
||||
any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd")
|
||||
))]
|
||||
impl Open for JackRodioSink {
|
||||
fn open(device: Option<String>) -> JackRodioSink {
|
||||
let host = cpal::host_from_id(
|
||||
|
@ -173,7 +179,10 @@ impl Sink for RodioSink {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "rodiojack-backend")]
|
||||
#[cfg(all(
|
||||
feature = "rodiojack-backend",
|
||||
any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd")
|
||||
))]
|
||||
impl Sink for JackRodioSink {
|
||||
fn start(&mut self) -> io::Result<()> {
|
||||
// More similar to an "unpause" than "play". Doesn't undo "stop".
|
||||
|
|
Loading…
Reference in a new issue