output/solaris: include sys/stropts.h only on Solaris

This header had been available for a long time on Linux, but was
removed in glibc 2.30.  This commit moves the `#include` line inside
the `#ifdef __sun` block and adds a fake declaration of `I_FLUSH` for
the Linux build.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/630
This commit is contained in:
Max Kellermann 2019-08-22 11:41:12 +02:00
parent e70f40fac1
commit 818b7e0641

View File

@ -22,7 +22,6 @@
#include "system/FileDescriptor.hxx"
#include "system/Error.hxx"
#include <sys/stropts.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
@ -31,11 +30,18 @@
#ifdef __sun
#include <sys/audio.h>
#include <sys/stropts.h>
#else
/* some fake declarations that allow build this plugin on systems
other than Solaris, just to see if it compiles */
#include <sys/ioctl.h>
#ifndef I_FLUSH
#define I_FLUSH 0
#endif
#define AUDIO_GETINFO 0
#define AUDIO_SETINFO 0
#define AUDIO_ENCODING_LINEAR 0