summaryrefslogtreecommitdiff
path: root/ext/socket/ifaddr.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-14 14:24:42 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-14 14:24:42 +0000
commit5ec5c6d52c69517d97cddd5daeb0b5c9af80ff81 (patch)
tree55bceed1296f72beaaa023ce046e4c08d5cc44c0 /ext/socket/ifaddr.c
parentb6decf289fb90e579733ed29571f0870c7a7c169 (diff)
socket: fix build error and warnings on mingw
* ext/socket/extconf.rb: check for if_nametoindex() for i686-w64-mingw32, and check for declarations of if_indextoname() and if_nametoindex(). * ext/socket/ifaddr.c (ifaddr_ifindex): not-implement unless if_nametoindex() is available. * ext/socket/rubysocket.h: declare if_indextoname() and if_nametoindex() if available but not declared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/ifaddr.c')
-rw-r--r--ext/socket/ifaddr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/socket/ifaddr.c b/ext/socket/ifaddr.c
index 446fe20..e5eb48b 100644
--- a/ext/socket/ifaddr.c
+++ b/ext/socket/ifaddr.c
@@ -135,6 +135,7 @@ ifaddr_name(VALUE self)
* Returns the interface index of _ifaddr_.
*/
+#ifdef HAVE_IF_NAMETOINDEX
static VALUE
ifaddr_ifindex(VALUE self)
{
@@ -146,6 +147,9 @@ ifaddr_ifindex(VALUE self)
}
return UINT2NUM(ifindex);
}
+#else
+#define ifaddr_ifindex rb_f_notimplement
+#endif
/*
* call-seq: