Subject: Re: trying to update avifile-devel
To: None <zuntum@netbsd.org>
From: Joachim Koenig-Baltes <joachim@handshake.de>
List: current-users
Date: 12/26/2001 22:19:21
On Tue, Dec 25, 2001, Tomasz Luchowski wrote:

> I am trying to update avifile-devel, but I see this thing:
[...]
> In file included from OssAudioRenderer.cpp:27:
> /usr/include/unistd.h:319: type specifier omitted for parameter
> /usr/include/unistd.h:319: type specifier omitted for parameter
> gmake[2]: *** [OssAudioRenderer.lo] Error 1
> gmake[2]: Leaving directory `/mem/graphics/avifile-devel/work/avifile-0.6/lib/aviplay'
> gmake[1]: *** [all-recursive] Error 1
> gmake[1]: Leaving directory `/mem/graphics/avifile-devel/work/avifile-0.6/lib'
> gmake: *** [all-recursive] Error 1
> *** Error code 2
> 
> Does this look like an easy thing to fix?

You can move the block 

#ifdef __NetBSD__
#include <soundcard.h>
#else
#include <sys/soundcard.h>
#endif

around line 18 of OssAudioRenderer.cpp behind the block of standard includes,
including the inclusion of unistd.h.

The problem seems to be, that soundcard.h defines _POSIX_SOURCE, includes
<machine/endian.h> which includes, via <sys/endian.h> -> 
<machine/endian_machdep.h> -> <machine/byte_swap.h> -> <sys/types.h> which
in turn only defines u_long and u_int only if _POSIX_SOURCE is _not_ defined,
before _POSIX_SOURCE gets undefined again in soundcard.h.

So, <sys/types.h> gets included in a _POSIX_SOURCE context, but the rest
of the includes does not impose these restrictions.

I think, <unistd.h> should use 'unsigned long' instead of u_long and
'unsigned int' instead of u_int in the prototype for profil(), but this
is more a question for our standards experts.

Joachim