Andreas Zeugswetter <andreas.zeugswetter@telecom.at> writes:
> I would simply do:
> #ifndef size_t
> typedef int size_t
> #endif
> #ifndef socklen_t
> typedef size_t socklen_t
> #endif
That has no hope of working, since typedefs generally are not macros.
Marc had the right idea: a configure test is the only real way to
discover how getsockname() is declared. A small problem is that
configure can only detect outright compilation failures, not warnings.
That's probably good enough, but people with nonstandard definitions
of getsockname may have to live with looking at warnings.
> and use socklen_t which is now standard for socket functions
It is? The machines I have access to think the parameter is plain,
unvarnished "int".
regards, tom lane