From 22a04e572036276261121d1e80da5ec1a96e4e17 Mon Sep 17 00:00:00 2001 From: akr Date: Wed, 13 Feb 2013 12:01:24 +0000 Subject: * ext/socket/extconf.rb: don't define socklen_t here, just test. * ext/socket/rubysocket.h: define socklen_t if not available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/socket/extconf.rb | 4 +--- ext/socket/rubysocket.h | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'ext/socket') diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb index f5d243ed47..5256cd0873 100644 --- a/ext/socket/extconf.rb +++ b/ext/socket/extconf.rb @@ -56,9 +56,7 @@ have_header("ucred.h", headers) have_type("struct addrinfo", headers) -unless have_type("socklen_t", headers) - $defs << "-Dsocklen_t=int" -end +have_type("socklen_t", headers) have_type("struct in_pktinfo", headers) {|src| src.sub(%r'^/\*top\*/', '\&'"\n#if defined(IPPROTO_IP) && defined(IP_PKTINFO)") << diff --git a/ext/socket/rubysocket.h b/ext/socket/rubysocket.h index ff91f51bb7..36833e6740 100644 --- a/ext/socket/rubysocket.h +++ b/ext/socket/rubysocket.h @@ -86,6 +86,10 @@ #include #endif +#ifndef HAVE_TYPE_SOCKLEN_T +typedef int socklen_t; +#endif + #ifndef EWOULDBLOCK #define EWOULDBLOCK EAGAIN #endif -- cgit v1.2.3