output/sndio: refuse to build with libroarsndio

RoarAudio's sndio emulation has been a source for annoyances.  First,
their headers turned out to be broken with C++, due to their use of
the "new" keyword.  Then they used a preprocessor macro to rename
"sio_hdl" to something else, effectively disallowing the use of
forward declarations.  Enough is enough, and I'm removing support for
it.

RoarAudio users should better use the RoarAudio output plugin.
This commit is contained in:
Max Kellermann 2017-09-19 19:38:15 +02:00
parent 20a5ef2798
commit 5ce93d6fa8
3 changed files with 21 additions and 12 deletions

1
NEWS
View File

@ -8,6 +8,7 @@ ver 0.21 (not yet released)
- pcm: support audio/L24 (RFC 3190)
* output
- alsa: non-blocking mode
- sndio: remove support for the broken RoarAudio sndio emulation
* mixer
- sndio: new mixer plugin

View File

@ -1131,10 +1131,26 @@ MPD_DEFINE_CONDITIONAL(enable_fifo, HAVE_FIFO,
[support for writing audio to a FIFO])
dnl ----------------------------------- SNDIO ----------------------------------
MPD_ENABLE_AUTO_HEADER([sndio], [SNDIO], [sndio.h],
[-lsndio], [],
[sndio output plugin],
[libsndio not found])
MPD_ARG_ENABLE([sndio], [SNDIO], [sndio output plugin], [], [
AC_SUBST([SNDIO_LIBS], [])
AC_SUBST([SNDIO_CFLAGS], [])
found_sndio=no
MPD_AUTO([sndio], [SNDIO], [sndio output plugin],
[AC_CHECK_HEADER([sndio.h],
[AC_PREPROC_IFELSE(
[AC_LANG_PROGRAM([
#include <sndio.h>
#ifdef ROAR_VERSION
#error libroarsndio not supported
#endif
])],
[found_sndio=yes SNDIO_LIBS='-lsndio' SNDIO_CFLAGS=''],
[AC_MSG_WARN([Found libroarsndio, which is known to be broken; ignoring it.])],
)]
)]
)
])
dnl ----------------------------------- Haiku ---------------------------------
MPD_ENABLE_AUTO_HEADER([haiku], [HAIKU], [media/MediaDefs.h],

View File

@ -24,16 +24,8 @@
#include "util/Domain.hxx"
#include "Log.hxx"
/* work around a C++ incompatibility if the sndio API is emulated by
libroar: libroar's "struct roar_service_stream" has a member named
"new", which is an illegal identifier in C++ */
#define new new_
#include <sndio.h>
/* undo the libroar workaround */
#undef new
#include <stdexcept>
#ifndef SIO_DEVANY