1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/socket/socket.c (IS_IP_FAMILY): defined.

(addrinfo_ip_p): use it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2009-01-12 14:32:21 +00:00
parent 839214e1e6
commit 68552c4248
2 changed files with 12 additions and 6 deletions

View file

@ -1,3 +1,8 @@
Mon Jan 12 23:31:42 2009 Tanaka Akira <akr@fsij.org>
* ext/socket/socket.c (IS_IP_FAMILY): defined.
(addrinfo_ip_p): use it.
Mon Jan 12 17:23:05 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/test/unit/assertions.rb (assert_nothing_raised): removes the

View file

@ -5106,6 +5106,12 @@ addrinfo_canonname(VALUE self)
return rai->canonname;
}
#ifdef AF_INET6
# define IS_IP_FAMILY(af) ((af) == AF_INET || (af) == AF_INET6)
#else
# define IS_IP_FAMILY(af) ((af) == AF_INET)
#endif
/*
* call-seq:
* addrinfo.ip? => true or false
@ -5123,12 +5129,7 @@ addrinfo_ip_p(VALUE self)
{
rb_addrinfo_t *rai = get_addrinfo(self);
int family = ai_get_afamily(rai);
return family == AF_INET
#ifdef AF_INET6
|| family == AF_INET6
#endif
? Qtrue : Qfalse;
return Qfalse;
return IS_IP_FAMILY(family) ? Qtrue : Qfalse;
}
/*