[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: typedef compatibility
On Fri, 18 Aug 2000, Erik Machnicki wrote:
> In old versions of FreeBSD, getsockname() expects an int*. In new
> versions of FreeBSD, it expects a socklen_t*, which is typedefed as
> unsigned int.
FreeBSD 4.x, no? My FreeBSD 3.4 code still uses
int
getsockname(int s, struct sockaddr *name, int *namelen)
> So, we need to check at compile-time whether socklen_t is defined or not.
> If it is, we make a variable of type socklen_t, otherwise we make a
> variable of type int.
>
> Anyone know how to do this?
This needs to be done thru autoconfig, I think. Likely, the easiest would
to mimic what is being done already with other data type changes already
in Mash or in other packages -- perl's autoconfig for example plays games
like this.
-- Denis