path: root/ext/socket
diff options
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-28 02:14:23 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-28 02:14:23 +0000
commit485181e4f714b12c4a6cea239d534da75454acdc (patch)
tree943802f79cc990d69e3415b2a33b714bcbdaf446 /ext/socket
parentc05e6a8cda4701d995d8e4b2390ee2b88b51e6d6 (diff)
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:// b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket')
2 files changed, 3 insertions, 1 deletions
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c
index 5af090c9b9..9344252864 100644
--- a/ext/socket/ancdata.c
+++ b/ext/socket/ancdata.c
@@ -1114,7 +1114,7 @@ static void *
nogvl_sendmsg_func(void *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
diff --git a/ext/socket/option.c b/ext/socket/option.c
index 1f334bbca0..4cef1c81c4 100644
--- a/ext/socket/option.c
+++ b/ext/socket/option.c
@@ -452,6 +452,8 @@ inet_ntop(int af, const void *addr, char *numaddr, size_t numaddr_len)
return numaddr;
+#elif !defined HAVE_ARPA_INET_H
+extern char *inet_ntop(int af, const void *addr, char *numaddr, size_t numaddr_len);
/* Although the buffer size needed depends on the prefixes, "%u" may generate "4294967295". */