The following change to dlls/winmm/wineoss/audio.c
revision 1.79 date: 2003/03/15 00:54:12; author: julliard; state: Exp; lines: +231 -73 Robert Reif reif@earthlink.net Added support for multiple direct sound devices.
unfortunately breaks compilation on FreeBSD:
audio.c: In function `OSS_WaveOutInit': audio.c:501: syntax error before `info' audio.c:502: `SOUND_MIXER_INFO' undeclared (first use in this function) audio.c:502: (Each undeclared identifier is reported only once audio.c:502: for each function it appears in.) audio.c:502: `info' undeclared (first use in this function) audio.c: In function `OSS_WaveInInit': audio.c:634: syntax error before `info' audio.c:635: `SOUND_MIXER_INFO' undeclared (first use in this function) audio.c:635: `info' undeclared (first use in this function)
As far as I can see mixer_info does not exist on FreeBSD 4.7 (at least).
I'm afraid I won't have the time to investigate this into more detail by myself; would you mind having a look?
Thanks, Gerald
Gerald Pfeifer pfeifer@dbai.tuwien.ac.at writes:
As far as I can see mixer_info does not exist on FreeBSD 4.7 (at least).
I'm afraid I won't have the time to investigate this into more detail by myself; would you mind having a look?
I added a couple of #ifdefs, it's not really the right solution but it should hopefully get you going. Let me know if it still doesn't work for you.
On Sat, 15 Mar 2003, Alexandre Julliard wrote:
I added a couple of #ifdefs, it's not really the right solution but it should hopefully get you going. Let me know if it still doesn't work for you.
It builds like a charm now, thanks!
The patch below is a most minor followup to avoid (warnings on) unused variables.
Gerald
ChangeLog: Avoid unused variables on systems without SOUND_MIXER_INFO.
Index: audio.c =================================================================== RCS file: /home/wine/wine/dlls/winmm/wineoss/audio.c,v retrieving revision 1.80 diff -u -3 -p -r1.80 audio.c --- audio.c 15 Mar 2003 22:23:27 -0000 1.80 +++ audio.c 16 Mar 2003 09:09:56 -0000 @@ -491,7 +491,10 @@ static BOOL OSS_WaveOutInit(OSS_DEVICE* { int rc,arg; int f,c,r; +#ifdef SOUND_MIXER_INFO int mixer; +#endif + TRACE("(%p) %s\n", ossdev, ossdev->dev_name);
if (OSS_OpenDevice(ossdev, O_WRONLY, NULL, 0,-1,-1,-1) != 0) return FALSE; @@ -626,7 +629,10 @@ static BOOL OSS_WaveInInit(OSS_DEVICE* o { int rc,arg; int f,c,r; +#ifdef SOUND_MIXER_INFO int mixer; +#endif + TRACE("(%p) %s\n", ossdev, ossdev->dev_name);
if (OSS_OpenDevice(ossdev, O_RDONLY, NULL, 0,-1,-1,-1) != 0) return FALSE;
On March 16, 2003 04:12 am, Gerald Pfeifer wrote:
int f,c,r;
+#ifdef SOUND_MIXER_INFO int mixer; +#endif
Please don't add even more ugly ifdefs just to avoid some warnings.
On Sun, 16 Mar 2003, Dimitrie O. Paun wrote:
+#ifdef SOUND_MIXER_INFO int mixer; +#endif
Please don't add even more ugly ifdefs just to avoid some warnings.
How else do you suggest we/I detect those code regressions that compiler warnings indicate?
Some may seem "cosmetic", but many of the patches I have submitted really were related to actual problems in the code; keeping the number of warnings to a sensible level really helps.
And I have studied every single warning in the past year or so and contributed many portability fixes as well as fixes really affecting GNU/Linux as well.
I really appreciate that Alexandre and most other developers care about portability; trying to eliminate warnings is somehow part of that.
Gerald
PS: Or would you prefer a dummy block
#ifdef SOUND_MIXER_INFO { int mixer; .... } #endif
instead of two #ifdefs?
On March 16, 2003 11:27 am, Gerald Pfeifer wrote:
PS: Or would you prefer a dummy block
#ifdef SOUND_MIXER_INFO { int mixer; .... } #endif
instead of two #ifdefs?
No, I don't. What about moving the #ifdef just around the
if (ioctl(mixer, SOUND_MIXER_INFO, &info) >= 0) {
Will that work?