curl-library
Re: Solaris 10 autobuild and recvfrom() sixth argument data type
Date: Mon, 21 Jul 2008 16:42:00 +0100
Yang Tse wrote:
> > Because 'socklen_t' and 'size_t' are unsigned, and 'int' is signed,
> > the only compatible prototype is 'void *'.
> >
> > Provided the type sizes are the same, there's no problem since the
> > values are always small and positive.
>
> Yes. But we certainly have to define an in/out variable to pass and
> hold a value referenced by the void pointer. I have opted for an
> unsigned int, http://cool.haxx.se/cvs.cgi/curl/ares/setup_once.h.diff?r1=1.29&r2=1.30
That's an interesting choice, because it's the one type which no unix
has ever used AFAIK :-)
I'd go for `socklen_t' if it exists, because it might be a wider type,
and if `socklen_t' does not exist I'd go for `int' or `unsigned int',
doesn't matter (`int' being historically standard though.)
-- Jamie
Received on 2008-07-21