Subject: soundcard.h and _POSIX_SOURCE
To: None <tech-userlevel@netbsd.org>
From: Krister Walfridsson <cato@df.lth.se>
List: tech-userlevel
Date: 03/17/1999 22:13:37
I have a problem with soundcard.h -- it defines _POSIX_SOURCE to prevent
dragging in a lot of junk when including machine/endian.h. This may
cause unexpected things to happen when you include files after
soundcard.h...

sys/midiio.h solves the same problem by

   #ifndef _POSIX_SOURCE
   #define __MIDIIO_UNSET_POSIX_SOURCE
   #define _POSIX_SOURCE         /* make sure we don't get all the gunk */
   #endif
   #include <machine/endian.h>
   #ifdef __MIDIIO_UNSET_POSIX_SOURCE
   #undef _POSIX_SOURCE
   #undef __MIDIIO_UNSET_POSIX_SOURCE
   #endif

Is it really that bad getting "all the gunk" from machine/endian.h, that
it warrants this kludge?

So what is the correct way of fixing soundcard.h? I prefere just removing
the #define, but I can live with the above construction too...

Comments?

   /Krister