From 1644b258473e9b88008ac353793a1f14124af08d Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 28 Mar 2011 22:11:45 +0200 Subject: [PATCH] wineoss.drv: Remove unnecessary ifdefs. --- dlls/wineoss.drv/Makefile.in | 3 +-- dlls/wineoss.drv/audio.c | 56 +++++++++++++++++++++++---------------- dlls/wineoss.drv/audio.h | 4 --- dlls/wineoss.drv/dscapture.c | 15 +++++++---- dlls/wineoss.drv/dsrender.c | 15 +++++++---- dlls/wineoss.drv/midi.c | 11 +++++++- dlls/wineoss.drv/mixer.c | 22 +++++++--------- dlls/wineoss.drv/mmaux.c | 19 ++++++------- dlls/wineoss.drv/oss.c | 63 -------------------------------------------- dlls/wineoss.drv/oss.h | 39 --------------------------- 10 files changed, 84 insertions(+), 163 deletions(-) delete mode 100644 dlls/wineoss.drv/oss.c delete mode 100644 dlls/wineoss.drv/oss.h diff --git a/dlls/wineoss.drv/Makefile.in b/dlls/wineoss.drv/Makefile.in index 18e72d170b0..ee9d897f2ce 100644 --- a/dlls/wineoss.drv/Makefile.in +++ b/dlls/wineoss.drv/Makefile.in @@ -8,7 +8,6 @@ C_SRCS = \ midi.c \ midipatch.c \ mixer.c \ - mmaux.c \ - oss.c + mmaux.c @MAKE_DLL_RULES@ diff --git a/dlls/wineoss.drv/audio.c b/dlls/wineoss.drv/audio.c index a4367fc87eb..7e1ca433b52 100644 --- a/dlls/wineoss.drv/audio.c +++ b/dlls/wineoss.drv/audio.c @@ -55,6 +55,16 @@ #ifdef HAVE_SYS_POLL_H # include #endif +#if defined(HAVE_SYS_SOUNDCARD_H) +# include +#elif defined(HAVE_MACHINE_SOUNDCARD_H) +# include +#elif defined(HAVE_SOUNDCARD_H) +# include +#endif +#ifdef HAVE_SYS_ERRNO_H +#include +#endif #include "windef.h" #include "winbase.h" @@ -70,7 +80,6 @@ #include "ksmedia.h" #include "initguid.h" #include "dsdriver.h" -#include "oss.h" #include "wine/debug.h" #include "audio.h" @@ -80,8 +89,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(wave); /* Allow 1% deviation for sample rates (some ES137x cards) */ #define NEAR_MATCH(rate1,rate2) (((100*((int)(rate1)-(int)(rate2)))/(rate1))==0) -#ifdef HAVE_OSS - WINE_WAVEOUT WOutDev[MAX_WAVEDRV]; WINE_WAVEIN WInDev[MAX_WAVEDRV]; unsigned numOutDev; @@ -3166,26 +3173,29 @@ DWORD WINAPI OSS_widMessage(WORD wDevID, WORD wMsg, DWORD_PTR dwUser, return MMSYSERR_NOTSUPPORTED; } -#else /* !HAVE_OSS */ - -/************************************************************************** - * wodMessage (WINEOSS.7) - */ -DWORD WINAPI OSS_wodMessage(WORD wDevID, WORD wMsg, DWORD_PTR dwUser, - DWORD_PTR dwParam1, DWORD_PTR dwParam2) -{ - FIXME("(%u, %04X, %08lX, %08lX, %08lX):stub\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); - return MMSYSERR_NOTENABLED; -} - /************************************************************************** - * widMessage (WINEOSS.6) + * DriverProc (WINEOSS.1) */ -DWORD WINAPI OSS_widMessage(WORD wDevID, WORD wMsg, DWORD_PTR dwUser, - DWORD_PTR dwParam1, DWORD_PTR dwParam2) -{ - FIXME("(%u, %04X, %08lX, %08lX, %08lX):stub\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); - return MMSYSERR_NOTENABLED; +LRESULT CALLBACK OSS_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, + LPARAM dwParam1, LPARAM dwParam2) +{ + TRACE("(%08lX, %p, %08X, %08lX, %08lX)\n", + dwDevID, hDriv, wMsg, dwParam1, dwParam2); + + switch(wMsg) { + case DRV_LOAD: + case DRV_FREE: + case DRV_OPEN: + case DRV_CLOSE: + case DRV_ENABLE: + case DRV_DISABLE: + case DRV_QUERYCONFIGURE: + return 1; + case DRV_CONFIGURE: MessageBoxA(0, "OSS MultiMedia Driver !", "OSS Driver", MB_OK); return 1; + case DRV_INSTALL: + case DRV_REMOVE: + return DRV_SUCCESS; + default: + return 0; + } } - -#endif /* HAVE_OSS */ diff --git a/dlls/wineoss.drv/audio.h b/dlls/wineoss.drv/audio.h index 1038a8f5062..602e842787e 100644 --- a/dlls/wineoss.drv/audio.h +++ b/dlls/wineoss.drv/audio.h @@ -25,8 +25,6 @@ # error You must include config.h to use this header #endif -#ifdef HAVE_OSS - /* unless someone makes a wineserver kernel module, Unix pipes are faster than win32 events */ #define USE_PIPE_SYNC @@ -183,5 +181,3 @@ extern DWORD widDsDesc(UINT wDevID, PDSDRIVERDESC desc); /* dsrender.c */ extern DWORD wodDsCreate(UINT wDevID, PIDSDRIVER* drv); extern DWORD wodDsDesc(UINT wDevID, PDSDRIVERDESC desc); - -#endif /* HAVE_OSS */ diff --git a/dlls/wineoss.drv/dscapture.c b/dlls/wineoss.drv/dscapture.c index e815e846dc9..1607e5a7119 100644 --- a/dlls/wineoss.drv/dscapture.c +++ b/dlls/wineoss.drv/dscapture.c @@ -42,6 +42,16 @@ #ifdef HAVE_SYS_POLL_H # include #endif +#if defined(HAVE_SYS_SOUNDCARD_H) +# include +#elif defined(HAVE_MACHINE_SOUNDCARD_H) +# include +#elif defined(HAVE_SOUNDCARD_H) +# include +#endif +#ifdef HAVE_SYS_ERRNO_H +#include +#endif #include "windef.h" #include "winbase.h" @@ -52,15 +62,12 @@ #include "mmreg.h" #include "dsound.h" #include "dsdriver.h" -#include "oss.h" #include "wine/debug.h" #include "audio.h" WINE_DEFAULT_DEBUG_CHANNEL(dscapture); -#ifdef HAVE_OSS - /*======================================================================* * Low level DSOUND capture definitions * *======================================================================*/ @@ -1327,5 +1334,3 @@ DWORD widDsDesc(UINT wDevID, PDSDRIVERDESC desc) memcpy(desc, &(WInDev[wDevID].ossdev.ds_desc), sizeof(DSDRIVERDESC)); return MMSYSERR_NOERROR; } - -#endif /* HAVE_OSS */ diff --git a/dlls/wineoss.drv/dsrender.c b/dlls/wineoss.drv/dsrender.c index 02849c78f8f..8161c88b84a 100644 --- a/dlls/wineoss.drv/dsrender.c +++ b/dlls/wineoss.drv/dsrender.c @@ -45,6 +45,16 @@ #ifdef HAVE_SYS_POLL_H # include #endif +#if defined(HAVE_SYS_SOUNDCARD_H) +# include +#elif defined(HAVE_MACHINE_SOUNDCARD_H) +# include +#elif defined(HAVE_SOUNDCARD_H) +# include +#endif +#ifdef HAVE_SYS_ERRNO_H +#include +#endif #include "windef.h" #include "winbase.h" @@ -55,15 +65,12 @@ #include "mmreg.h" #include "dsound.h" #include "dsdriver.h" -#include "oss.h" #include "wine/debug.h" #include "audio.h" WINE_DEFAULT_DEBUG_CHANNEL(wave); -#ifdef HAVE_OSS - /*======================================================================* * Low level DSOUND definitions * *======================================================================*/ @@ -963,5 +970,3 @@ DWORD wodDsDesc(UINT wDevID, PDSDRIVERDESC desc) *desc = WOutDev[wDevID].ossdev.ds_desc; return MMSYSERR_NOERROR; } - -#endif /* HAVE_OSS */ diff --git a/dlls/wineoss.drv/midi.c b/dlls/wineoss.drv/midi.c index 73d082601d2..5b3fd5d72a6 100644 --- a/dlls/wineoss.drv/midi.c +++ b/dlls/wineoss.drv/midi.c @@ -60,6 +60,16 @@ #ifdef HAVE_SYS_POLL_H #include #endif +#if defined(HAVE_SYS_SOUNDCARD_H) +# include +#elif defined(HAVE_MACHINE_SOUNDCARD_H) +# include +#elif defined(HAVE_SOUNDCARD_H) +# include +#endif +#ifdef HAVE_SYS_ERRNO_H +#include +#endif #include "windef.h" #include "winbase.h" @@ -67,7 +77,6 @@ #include "winuser.h" #include "winnls.h" #include "mmddk.h" -#include "oss.h" #include "wine/unicode.h" #include "wine/debug.h" diff --git a/dlls/wineoss.drv/mixer.c b/dlls/wineoss.drv/mixer.c index 9b6dacc1ede..e2c33a0f9e0 100644 --- a/dlls/wineoss.drv/mixer.c +++ b/dlls/wineoss.drv/mixer.c @@ -41,6 +41,16 @@ #ifdef HAVE_SYS_IOCTL_H # include #endif +#if defined(HAVE_SYS_SOUNDCARD_H) +# include +#elif defined(HAVE_MACHINE_SOUNDCARD_H) +# include +#elif defined(HAVE_SOUNDCARD_H) +# include +#endif +#ifdef HAVE_SYS_ERRNO_H +#include +#endif #define NONAMELESSUNION #define NONAMELESSSTRUCT @@ -48,14 +58,11 @@ #include "winbase.h" #include "winnls.h" #include "mmddk.h" -#include "oss.h" #include "wine/unicode.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(mixer); -#ifdef HAVE_OSS - #define MAX_MIXERDRV (6) #define WINE_MIXER_MANUF_ID 0xAA @@ -1509,15 +1516,12 @@ static DWORD MIX_GetNumDevs(void) return MIX_NumMixers; } -#endif /* HAVE_OSS */ - /************************************************************************** * mxdMessage (WINEOSS.3) */ DWORD WINAPI OSS_mxdMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, DWORD_PTR dwParam1, DWORD_PTR dwParam2) { -#ifdef HAVE_OSS TRACE("(%04X, %s, %08lX, %08lX, %08lX);\n", wDevID, getMessage(wMsg), dwUser, dwParam1, dwParam2); @@ -1552,10 +1556,4 @@ DWORD WINAPI OSS_mxdMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, WARN("unknown message %d!\n", wMsg); return MMSYSERR_NOTSUPPORTED; } -#else - TRACE("(%04X, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg, - dwUser, dwParam1, dwParam2); - - return MMSYSERR_NOTENABLED; -#endif } diff --git a/dlls/wineoss.drv/mmaux.c b/dlls/wineoss.drv/mmaux.c index e48df5dd3fa..bb8f35b4b45 100644 --- a/dlls/wineoss.drv/mmaux.c +++ b/dlls/wineoss.drv/mmaux.c @@ -31,18 +31,25 @@ #ifdef HAVE_SYS_IOCTL_H # include #endif +#if defined(HAVE_SYS_SOUNDCARD_H) +# include +#elif defined(HAVE_MACHINE_SOUNDCARD_H) +# include +#elif defined(HAVE_SOUNDCARD_H) +# include +#endif +#ifdef HAVE_SYS_ERRNO_H +#include +#endif #include "windef.h" #include "winbase.h" #include "mmddk.h" -#include "oss.h" #include "wine/unicode.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(mmaux); -#ifdef HAVE_OSS - #define MIXER_DEV "/dev/mixer" static int NumDev = 6; @@ -220,8 +227,6 @@ static DWORD AUX_SetVolume(WORD wDevID, DWORD dwParam) return MMSYSERR_NOERROR; } -#endif - /************************************************************************** * auxMessage (WINEOSS.2) */ @@ -231,7 +236,6 @@ DWORD WINAPI OSS_auxMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, TRACE("(%04X, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); -#ifdef HAVE_OSS switch (wMsg) { case DRVM_INIT: return OSS_AuxInit(); @@ -254,7 +258,4 @@ DWORD WINAPI OSS_auxMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, WARN("unknown message !\n"); } return MMSYSERR_NOTSUPPORTED; -#else - return MMSYSERR_NOTENABLED; -#endif } diff --git a/dlls/wineoss.drv/oss.c b/dlls/wineoss.drv/oss.c deleted file mode 100644 index 2a54c734ee7..00000000000 --- a/dlls/wineoss.drv/oss.c +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- tab-width: 8; c-basic-offset: 4 -*- */ -/* - * Wine Driver for Open Sound System - * - * Copyright 1999 Eric Pouech - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include "config.h" - -#include - -#include "windef.h" -#include "winbase.h" -#include "wingdi.h" -#include "winuser.h" -#include "mmddk.h" -#include "oss.h" -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(wave); - -/************************************************************************** - * DriverProc (WINEOSS.1) - */ -LRESULT CALLBACK OSS_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, - LPARAM dwParam1, LPARAM dwParam2) -{ - TRACE("(%08lX, %p, %08X, %08lX, %08lX)\n", - dwDevID, hDriv, wMsg, dwParam1, dwParam2); - - switch(wMsg) { -#ifdef HAVE_OSS - case DRV_LOAD: - case DRV_FREE: - case DRV_OPEN: - case DRV_CLOSE: - case DRV_ENABLE: - case DRV_DISABLE: - case DRV_QUERYCONFIGURE: - return 1; - case DRV_CONFIGURE: MessageBoxA(0, "OSS MultiMedia Driver !", "OSS Driver", MB_OK); return 1; - case DRV_INSTALL: - case DRV_REMOVE: - return DRV_SUCCESS; -#endif - default: - return 0; - } -} diff --git a/dlls/wineoss.drv/oss.h b/dlls/wineoss.drv/oss.h deleted file mode 100644 index e1c9c89bb9f..00000000000 --- a/dlls/wineoss.drv/oss.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Definition for OSS drivers : wine multimedia system - * - * Copyright 1999 Eric Pouech - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_CONFIG_H -# error You must include config.h to use this header -#endif - -#if defined(HAVE_SYS_SOUNDCARD_H) -# include -#elif defined(HAVE_MACHINE_SOUNDCARD_H) -# include -#elif defined(HAVE_SOUNDCARD_H) -# include -#endif - -#ifdef HAVE_SYS_ERRNO_H -#include -#endif - -/* check for one of the Open Sound System specific SNDCTL_ defines */ -#ifdef SNDCTL_DSP_STEREO -# define HAVE_OSS -#endif -- 2.11.4.GIT