* ext/socket/extconf.rb: don't define HAVE_SA_LEN and HAVE_SA_LEN.

use HAVE_STRUCT_SOCKADDR_SA_LEN and HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
  instead.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2013-02-13 23:20:27 +00:00
Родитель eb4ae6bc54
Коммит ed193c50f5
5 изменённых файлов: 14 добавлений и 12 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Thu Feb 14 08:18:47 2013 Tanaka Akira <akr@fsij.org>
* ext/socket/extconf.rb: don't define HAVE_SA_LEN and HAVE_SA_LEN.
use HAVE_STRUCT_SOCKADDR_SA_LEN and HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
instead.
Wed Feb 13 20:59:48 2013 Tanaka Akira <akr@fsij.org>
* ext/socket/extconf.rb: don't define socklen_t here, just test.

Просмотреть файл

@ -74,9 +74,9 @@ 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
if have_struct_member("struct sockaddr_in", "sin_len", headers)
$defs[-1] = "-DHAVE_SIN_LEN" # change from -DHAVE_ST_SIN_LEN.
end
# 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)}
@ -87,10 +87,6 @@ if (doug[] or
doug[] or with_cppflags($CPPFLAGS + " -Dss_len=__ss_len", &doug)
end
if have_struct_member("struct sockaddr", "sa_len", headers)
$defs[-1] = "-DHAVE_SA_LEN " # change from -DHAVE_ST_SA_LEN.
end
have_struct_member('struct msghdr', 'msg_control', ['sys/types.h', 'sys/socket.h'])
have_struct_member('struct msghdr', 'msg_accrights', ['sys/types.h', 'sys/socket.h'])

Просмотреть файл

@ -136,7 +136,7 @@ typedef int socklen_t;
_SS_PAD1SIZE - _SS_ALIGNSIZE)
struct sockaddr_storage {
#ifdef HAVE_SA_LEN
#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
unsigned char ss_len; /* address length */
unsigned char ss_family; /* address family */
#else

Просмотреть файл

@ -1698,7 +1698,7 @@ socket_s_ip_address_list(VALUE self)
if (IS_IP_FAMILY(addr->sa_family)) {
rb_ary_push(list, sockaddr_obj(addr));
}
#ifdef HAVE_SA_LEN
#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
# ifndef _SIZEOF_ADDR_IFREQ
# define _SIZEOF_ADDR_IFREQ(r) \
(sizeof(struct ifreq) + \

Просмотреть файл

@ -13,7 +13,7 @@
#ifdef SA_LEN
# define SS_LEN(ss) (ss)->ss_len
#else
# ifdef HAVE_SA_LEN
# ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
# define SA_LEN(sa) (sa)->sa_len
# define SS_LEN(ss) (ss)->ss_len
# else
@ -32,7 +32,7 @@
# endif
#endif
#ifdef HAVE_SA_LEN
#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
# define SET_SA_LEN(sa, len) (void)((sa)->sa_len = (len))
# define SET_SS_LEN(ss, len) (void)((ss)->ss_len = (len))
#else
@ -40,7 +40,7 @@
# define SET_SS_LEN(ss, len) (void)(len)
#endif
#ifdef HAVE_SIN_LEN
#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
# define SIN_LEN(si) (si)->sin_len
# define SET_SIN_LEN(si,len) (si)->sin_len = (len)
#else