Re: [Plib-users] PLib compilation fails on OpenBSD
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2001-04-09 05:29:17
|
Heikki Korpela wrote: > > > On Sun, 8 Apr 2001, I wrote on a plib (http://plib.sourceforge.net) > > compilation problem: > > > sl.h:96: macro `ioctl' used with only 2 args > > On Sun, 8 Apr 2001, Steve Baker wrote: > > > I think (from the sound of the error), that OpenBSD has somehow defined 'ioctl' > > as a macro - that's **WRONG** because in C++ you should be able to overload > > the names of system functions (as we have done here) - but if the host OS > > defines them as macro's, that won't work. > > /usr/include/soundcard.h:#define ioctl(fd, com, argp) _oss_ioctl(fd, com, argp) Eeeuuuwwww! That **STINKS**. So that redirects *all* of your ioctls via some OSS emulator? Even the ones that are nothing to do with sound? Yuk! What a *horrible* kludge! So if I say: int (*func)(...) ; func = ioctl ; (*func)(...) ; ...it all falls apart! > /usr/include/sys/ioctl.h:int ioctl __P((int, unsigned long, ...)); > > soundcard.h gives you Linux OSS emulation. Hmmmm - sortof - certainly it failed to do so in this case. > Preferred way on OpenBSD is to use sys/audioio.h, which is the native > audio interface and generally best kept up-to-date. > > slPortability.h tries to use OSS instead, however. Well, OSS has a richer interface than /dev/audio - and it's a lot more widely supported across platforms...I'd prefer to use OSS if possible. > A simple workaround as follows. I guess you would have to have a > way to use OSS too under OpenBSD, though. > > diff -uNr plib-1.2.0.orig/src/sl/slPortability.h plib-1.2.0/src/sl/slPortability.h > --- plib-1.2.0.orig/src/sl/slPortability.h Wed Jun 28 04:32:58 2000 > +++ plib-1.2.0/src/sl/slPortability.h Mon Apr 9 06:50:37 2001 > @@ -42,7 +42,7 @@ > #include <limits.h> > #include <math.h> > > -#if (defined(__linux__) || defined(BSD)) && !defined(__NetBSD__) > +#if (defined(__linux__) || defined(BSD)) && !defined(__NetBSD__) && !defined(__OpenBSD__) > #define SL_USING_OSS_AUDIO 1 > #endif I wonder why only *Open* BSD suffers from this problem? I thought all the BSD varients were pretty similar these days? (I guess that's typical of a Linux user's perspective!) Well, I think it might be better just to rename our ioctl member function and stick with OSS. -- Steve Baker HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://web2.airmail.net/sjbaker1 Projects : http://plib.sourceforge.net http://tuxaqfh.sourceforge.net http://tuxkart.sourceforge.net http://prettypoly.sourceforge.net http://freeglut.sourceforge.net |