From 2fa61afb4e8d575c3d5facf4072e91187945e163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sat, 17 Mar 2007 06:59:31 +0000 Subject: Clean up configure checks for OSS support. Check for the various soundcard.h headers, and then include the best one that has been found on the system. Check for definition of SNDCTL_DSP_SETFRAGMENT in those headers. Check for the correct request parameter type for ioctl(), as also modern Linux uses unsigned long. Don't list all the big endian machines (as they aren't reliable to list anyway, some of them might work with both endians), use WORDS_BIGENDIAN instead. CVS patchset: 8697 CVS date: 2007/03/17 06:59:31 --- src/audio_out/audio_oss_out.c | 39 +++++++++++++++------------------------ 1 file changed, 15 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/audio_out/audio_oss_out.c b/src/audio_out/audio_oss_out.c index 12a52b997..793b47650 100644 --- a/src/audio_out/audio_oss_out.c +++ b/src/audio_out/audio_oss_out.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_oss_out.c,v 1.119 2007/03/16 17:13:57 dgp85 Exp $ + * $Id: audio_oss_out.c,v 1.120 2007/03/17 06:59:31 dgp85 Exp $ * * 20-8-2001 First implementation of Audio sync and Audio driver separation. * Copyright (C) 2001 James Courtier-Dutton James@superbug.demon.co.uk @@ -48,20 +48,19 @@ #include #include #include -#if defined(__OpenBSD__) -# include -#elif defined (__FreeBSD__) -# if __FreeBSD__ < 4 -# include -# else -# include -# endif -#else -# include -#endif #include #include +#ifdef HAVE_SYS_SOUNDCARD_H +# include +#endif +#ifdef HAVE_MACHINE_SOUNDCARD_H +# include +#endif +#ifdef HAVE_SOUNDCARD_H +# include +#endif + #define LOG_MODULE "audio_oss_out" #define LOG_VERBOSE /* @@ -86,8 +85,7 @@ #endif #ifndef AFMT_S16_NE -# if defined(sparc) || defined(__sparc__) || defined(PPC) -/* Big endian machines */ +# ifdef WORDS_BIGENDIAN # define AFMT_S16_NE AFMT_S16_BE # else # define AFMT_S16_NE AFMT_S16_LE @@ -115,13 +113,6 @@ #define OSS_SYNC_SOFTSYNC 3 #define OSS_SYNC_PROBEBUFFER 4 -/* On FreeBSD the request type is unsigned long rather than int */ -#ifdef __FreeBSD__ -typedef unsigned long ioctl_request_t; -#else -typedef int ioctl_request_t; -#endif - typedef struct oss_driver_s { ao_driver_t ao_driver; @@ -532,7 +523,7 @@ static int ao_oss_get_property (ao_driver_t *this_gen, int property) { if(!this->mixer.mute) { if(this->mixer.fd != -1) { - ioctl_request_t cmd = 0; + IOCTL_REQUEST_TYPE cmd = 0; int v; ioctl(this->mixer.fd, SOUND_MIXER_READ_DEVMASK, &audio_devs); @@ -571,7 +562,7 @@ static int ao_oss_set_property (ao_driver_t *this_gen, int property, int value) if(!this->mixer.mute) { if(this->mixer.fd != -1) { - ioctl_request_t cmd = 0; + IOCTL_REQUEST_TYPE cmd = 0; int v; ioctl(this->mixer.fd, SOUND_MIXER_READ_DEVMASK, &audio_devs); @@ -600,7 +591,7 @@ static int ao_oss_set_property (ao_driver_t *this_gen, int property, int value) if(this->mixer.mute) { if(this->mixer.fd != -1) { - ioctl_request_t cmd = 0; + IOCTL_REQUEST_TYPE cmd = 0; int v = 0; ioctl(this->mixer.fd, SOUND_MIXER_READ_DEVMASK, &audio_devs); -- cgit v1.2.3