NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Porting an OSS application



In article <20120503223052.1bef66c8.dieter.NetBSD%pandora.be@localhost>,
dieter roelants  <dieter.NetBSD%pandora.be@localhost> wrote:
>On Wed, 02 May 2012 12:42:36 +0200
>Riccardo Mottola <riccardo.mottola%libero.it@localhost> wrote:
>
>> When I compile it, I get:
>> OSS.m: In function '-[OSS _setRateAndChannels]':
>> OSS.m:111:37: error: macro "ioctl" requires 3 arguments, but only 2 given
>> OSS.m:111:39: warning: comparison between pointer and integer
>> gmake[4]: *** [obj/OSS.obj/OSS.m.o] Error 1
>> 
>> the offending line is:
>> 
>> if (ioctl (dspFd, SNDCTL_DSP_RESET) == -1)
>> 
>> Why the error? the argument number is variadic and it compiles on the 
>> abovementioned platforms (as well as FreeBSD and others). It is such 
>> also in the examples you find aorund on the net.
>
>soundcard.h contains:
>
>#include <sys/ioctl.h>
>#define ioctl(x,y,z) _oss_ioctl(x,y,z)

perhaps defining it this way is better:

#define ioctl(x, y, ...) _oss_ioctl(x, y, __VA_ARGS__)

christos



Home | Main Index | Thread Index | Old Index