summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--ext/socket/extconf.rb4
-rw-r--r--ext/socket/rubysocket.h4
3 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index f13ed2d..8f558d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Feb 13 20:59:48 2013 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/extconf.rb: don't define socklen_t here, just test.
+
+ * ext/socket/rubysocket.h: define socklen_t if not available.
+
Wed Feb 13 18:37:50 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* proc.c (mnew): skip prepending modules and return the method bound
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index f5d243e..5256cd0 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 ff91f51..36833e6 100644
--- a/ext/socket/rubysocket.h
+++ b/ext/socket/rubysocket.h
@@ -86,6 +86,10 @@
#include <ucred.h>
#endif
+#ifndef HAVE_TYPE_SOCKLEN_T
+typedef int socklen_t;
+#endif
+
#ifndef EWOULDBLOCK
#define EWOULDBLOCK EAGAIN
#endif