Simon Josefsson <[EMAIL PROTECTED]> writes:

> The follow patch appear to silent compiler warnings.  Can anyone think
> of a better way to fix this?  If not I'll commit and push this shortly.
[...]
> +# if defined _WIN32 || defined __WIN32__
> +#  define setsockopt(a,b,c,d,e) setsockopt(a,b,c,(const void*)(d),e)
> +# endif

I do not know whether it is better, but the following is more
type-safe:

# if defined _WIN32 || defined __WIN32__
#  define setsockopt(a,b,c,d,e) rpl_setsockopt(a,b,c,d,e)
static inline int
rpl_setsockopt(int socket, int level, int optname, const void *optval,
               socklen_t optlen)
{
  return (setsockopt)(socket, level, optname, optval, optlen);
}
# endif

(Funny, the glibc manual I have here omits the "const" from the
optval parameter.)
-- 
"Because computer source code is an expressive means for the exchange
 of information and ideas about computer programming, we hold that it
 is protected by the First Amendment."
--Hon. Boyce F. Martin, Jr., for the 6th Circuit Court, Junger vs. Daley



Reply via email to