Ben Pfaff <[EMAIL PROTECTED]> writes:
> 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
Applied, thanks. (Windows setsockopt has a 'int' final parameter,
although socklen_t is int on Windows.)
/Simon