From 7a68b1e71fd2f29478b95a5116ab0792f218f9ff Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Sat, 29 Feb 2020 09:56:10 +0100 Subject: [PATCH] Adapt SolarisOutputPlugin.cxx to be usable on NetBSD. --- NEWS | 2 ++ src/output/plugins/SolarisOutputPlugin.cxx | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 4648d09a0..741938b37 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ ver 0.21.21 (not yet released) * decoder - gme: ignore empty tags +* output + - solaris: port to NetBSD ver 0.21.20 (2020/02/16) * decoder diff --git a/src/output/plugins/SolarisOutputPlugin.cxx b/src/output/plugins/SolarisOutputPlugin.cxx index d6323d5aa..5176f7ac4 100644 --- a/src/output/plugins/SolarisOutputPlugin.cxx +++ b/src/output/plugins/SolarisOutputPlugin.cxx @@ -22,22 +22,23 @@ #include "system/FileDescriptor.hxx" #include "system/Error.hxx" +#include #include #include #include #include #include -#ifdef __sun +#if defined(__sun) #include #include +#elif defined(__NetBSD__) +#include #else /* some fake declarations that allow build this plugin on systems other than Solaris, just to see if it compiles */ -#include - #ifndef I_FLUSH #define I_FLUSH 0 #endif @@ -147,7 +148,11 @@ SolarisOutput::Play(const void *chunk, size_t size) void SolarisOutput::Cancel() noexcept { +#if defined(AUDIO_FLUSH) + ioctl(fd.Get(), AUDIO_FLUSH); +#elif defined(I_FLUSH) ioctl(fd.Get(), I_FLUSH); +#endif } const struct AudioOutputPlugin solaris_output_plugin = {