Subject: sys/lock.h and pri_t
To: None <current-users@netbsd.org>
From: Kurt Schreiner <ks@ub.uni-mainz.de>
List: current-users
Date: 05/31/2007 12:00:05
Hi,

while trying to get qemu (from pkgsrc) compiled on -current (i386)
I find (besides some other problems):

===> Building for qemu-0.9.0
gcc -DQEMU_TOOL -O2 -pipe -I/opt/nb/include -DGLX_GLXEXT_LEGACY -I/usr/include -Wall -O2 -g -fno-strict-aliasing -I/opt/nb/include -DGLX_GLXEXT_LEGACY -I/usr/include -I. -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE   -L/opt/nb/gcc3/lib/gcc-lib/i386--netbsdelf2.0/3.3.6 -Wl,-R/opt/nb/gcc3/lib/gcc-lib/i386--netbsdelf2.0/3.3.6 -L/opt/nb/gcc3/lib -Wl,-R/opt/nb/gcc3/lib -L/opt/nb/lib -Wl,-R/opt/nb/lib -L/usr/lib -Wl,-R/usr/lib -L/usr/X11R6/lib -Wl,-R/usr/X11R6/lib -g  -o qemu-img qemu-img.c cutils.c block.c block-raw.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c block-qcow2.c -lz  -lrt
cutils.c: In function `stristart':
cutils.c:75: warning: subscript has type `char'
cutils.c:75: warning: subscript has type `char'
In file included from /usr/include/sys/disk.h:92,
                 from block.c:32:
/usr/include/sys/lock.h:117: error: syntax error before "pri_t"
/usr/include/sys/lock.h:132: error: syntax error before '}' token
/usr/include/sys/lock.h:151: error: syntax error before '}' token
[... more errors ...]

block.c includes sys/types.h where pri_t is defined BUT:
enclosed in #ifdef _NETBSD_SOURCE. So where's the error: Using "pri_t"
in sys/lock.h w/o enclosing in #ifdef _NETBSD_SOURCE or should I simply
put a "typedef unsinged int pri_t;" somwhere in block.c before sys/lock.h
is included?

Kurt