Subject: Re: sys/lock.h and pri_t
To: None <current-users@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: current-users
Date: 06/03/2007 13:28:44
In article <m2d50dbebc.wl%hira@po6.nsk.ne.jp>,
Kouichirou Hiratsuka <hira@po6.nsk.ne.jp> wrote:
>Hello,
>
>At Thu, 31 May 2007 12:00:05 +0200,
>Kurt Schreiner wrote:
>> 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?
>
>Please see:
>
> http://mail-index.NetBSD.org/pkgsrc-users/2007/04/22/0000.html
>
>best regards.
We need to do some symbol hiding there, because we don't really want pri_t
in the application namespace.
christos