From 5ec5c6d52c69517d97cddd5daeb0b5c9af80ff81 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 14 May 2013 14:24:42 +0000 Subject: 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 --- ext/socket/extconf.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'ext/socket/extconf.rb') diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb index 88e7366e37..458871fbd9 100644 --- a/ext/socket/extconf.rb +++ b/ext/socket/extconf.rb @@ -421,7 +421,20 @@ EOF have_func("getpeerucred(0, (ucred_t **)NULL)", headers) # SunOS - have_func('if_indextoname(0, "")', headers) + have_func_decl = proc do |name, headers| + if !checking_for("declaration of #{name}()") {!%w[int void].all? {|ret| try_compile(<