Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Dec 2002 18:55:03 -0500
From:      Mike Barcroft <mike@FreeBSD.org>
To:        Nate Lawson <nate@root.org>
Cc:        current@freebsd.org
Subject:   Re: __BSD_VISIBLE and u_int
Message-ID:  <20021213185503.G61753@espresso.q9media.com>
In-Reply-To: <Pine.BSF.4.21.0212131423560.37378-100000@root.org>; from nate@root.org on Fri, Dec 13, 2002 at 02:26:12PM -0800
References:  <20021211195330.A50528@espresso.q9media.com> <Pine.BSF.4.21.0212131423560.37378-100000@root.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Nate Lawson <nate@root.org> writes:
> On Wed, 11 Dec 2002, Mike Barcroft wrote:
> > Nate Lawson <nate@root.org> writes:
> > > What's the proper way to get a typedef for u_int?  Is there a doc
> > > somewhere on what we expect in terms of #defines for 3rd party application
> > > authors?
> > 
> > <sys/types.h> will give you a typedef, provided you aren't writing a
> > POSIX or X/Open application.  If you're writing a POSIX or X/Open
> > application (the only time __BSD_VISIBLE is false) you'll have to do
> > the typedef manually in your application.
> 
> Hmm, which of these defines claims posix src? -D_ANSI_SOURCE ?

_ANSI_SOURCE means a strictly conforming C89 application.  Everything
in sys is off limits for such a program.

> cc -O -c -O -pipe -mcpu=pentiumpro -mcpu=pentiumpro -I./../include
> -I./.. -DDIRENT=1 -DDIRENT=1 -DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1
> -DHAVE_FCNTL_H=1 -DHAVE_ST_RDEV=1 -DHAVE_TM_ZONE=1
> -DHAVE_LONG_FILE_NAMES=1 -DHAVE_RESTARTABLE_SYSCALLS=1 -D_ANSI_SOURCE
> -DHAVE_DEV_CONSOLE=1 os.c
> In file included from os.c:25:
> /usr/include/sys/file.h:130: syntax error before "u_int"
> 
> > u_int is undocumented and unportable, so it probably shouldn't be
> > used.  It's only 3 characters shorter than `unsigned' anyway.
> 
> It's for ports.

I fixed a port like this recently.  _ANSI_SOURCE was actually added by
the port, not the application vendor, in that case.

Best regards,
Mike Barcroft

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021213185503.G61753>