summaryrefslogtreecommitdiff
path: root/ext/socket/extconf.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-15 22:19:05 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-15 22:19:05 +0000
commitcb31e783798438420e33a84a8bfe66acafaa7c4a (patch)
treeabd633cd3da6ebf4155f883b0179866487235998 /ext/socket/extconf.rb
parent84a525bc4e47c33c07cc135e6e77df1369375042 (diff)
* ext/socket/extconf.rb: test struct sockaddr_un and its member,
sun_len. * ext/socket/sockport.h (INIT_SOCKADDR_UN): new macro defined. * ext/socket/socket.c (sock_s_pack_sockaddr_un): use INIT_SOCKADDR_UN. * ext/socket/unixsocket.c (rsock_init_unixsock): ditto. * ext/socket/raddrinfo.c (init_unix_addrinfo): ditto. (addrinfo_mload): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/extconf.rb')
-rw-r--r--ext/socket/extconf.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index bb7be28..8e95dbb 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -50,6 +50,13 @@ end
end
}
+have_struct_member("struct sockaddr", "sa_len", headers) # 4.4BSD
+have_struct_member("struct sockaddr_in", "sin_len", headers) # 4.4BSD
+
+if have_type("struct sockaddr_un", headers) # POSIX
+ have_struct_member("struct sockaddr_un", "sun_len", headers) # 4.4BSD
+end
+
have_type("struct sockaddr_storage", headers)
have_type("struct addrinfo", headers)
@@ -72,10 +79,6 @@ have_type("struct ip_mreq", headers) # 4.4BSD
have_type("struct ip_mreqn", headers) # Linux 2.4
have_type("struct ipv6_mreq", headers) # RFC 3493
-# 4.4BSD
-have_struct_member("struct sockaddr", "sa_len", headers)
-have_struct_member("struct sockaddr_in", "sin_len", headers)
-
# doug's fix, NOW add -Dss_family... only if required!
doug = proc {have_struct_member("struct sockaddr_storage", "ss_family", headers)}
if (doug[] or