ext/socket: suppress warnings on mingw64

* ext/socket/ancdata.c (nogvl_sendmsg_func): explicitly cast via VALUE
  to suppress a warning on mingw64.
* ext/socket/option.c: declare inet_ntop() for mingw64 which has the
  function but lacks arpa/inet.h.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-07-28 02:14:23 +00:00
parent c05e6a8cda
commit 485181e4f7
2 changed files with 3 additions and 1 deletions

View File

@ -1114,7 +1114,7 @@ static void *
nogvl_sendmsg_func(void *ptr) nogvl_sendmsg_func(void *ptr)
{ {
struct sendmsg_args_struct *args = ptr; struct sendmsg_args_struct *args = ptr;
return (void *)sendmsg(args->fd, args->msg, args->flags); return (void *)(VALUE)sendmsg(args->fd, args->msg, args->flags);
} }
static ssize_t static ssize_t

View File

@ -452,6 +452,8 @@ inet_ntop(int af, const void *addr, char *numaddr, size_t numaddr_len)
#endif #endif
return numaddr; return numaddr;
} }
#elif !defined HAVE_ARPA_INET_H
extern char *inet_ntop(int af, const void *addr, char *numaddr, size_t numaddr_len);
#endif #endif
/* Although the buffer size needed depends on the prefixes, "%u" may generate "4294967295". */ /* Although the buffer size needed depends on the prefixes, "%u" may generate "4294967295". */