* ext/socket/extconf.rb: use headers instead of "netdb.h" in checking

getnameinfo() and getaddrinfo() because Windows doesn't have it.
	  see [ruby-dev:37757].

	* ext/socket/sockport.h (SA_LEN): use sockaddr_in6 when defined AF_INET6
	  if INET6 is not defined.  winsock2's getaddrinfo() returns
	  sockaddr_in6 if ipv6 is available.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2009-01-12 17:59:45 +00:00
Родитель f0e91e54a3
Коммит 370ffc6a2a
3 изменённых файлов: 13 добавлений и 3 удалений

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

@ -1,3 +1,13 @@
Tue Jan 13 02:54:54 2009 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/socket/extconf.rb: use headers instead of "netdb.h" in checking
getnameinfo() and getaddrinfo() because Windows doesn't have it.
see [ruby-dev:37757].
* ext/socket/sockport.h (SA_LEN): use sockaddr_in6 when defined AF_INET6
if INET6 is not defined. winsock2's getaddrinfo() returns
sockaddr_in6 if ipv6 is available.
Tue Jan 13 02:21:43 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* win32/win32.c (internal_cmd_match): extracted from
@ -11,7 +21,7 @@ Tue Jan 13 02:21:43 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
Tue Jan 13 02:07:38 2009 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk.rb: use Encoding.find("locale") instaed of
* ext/tk/lib/tk.rb: use Encoding.find("locale") instead of
Encoding.locale_charmap
Tue Jan 13 00:57:56 2009 Tanaka Akira <akr@fsij.org>

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

@ -244,7 +244,7 @@ end
$objs = ["socket.#{$OBJEXT}"]
unless getaddr_info_ok and have_func("getnameinfo", "netdb.h") and have_func("getaddrinfo", "netdb.h")
unless getaddr_info_ok and have_func("getnameinfo", headers) and have_func("getaddrinfo", headers)
if have_struct_member("struct in6_addr", "s6_addr8", headers)
$defs[-1] = "-DHAVE_ADDR8"
end

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

@ -14,7 +14,7 @@
# ifdef HAVE_SA_LEN
# define SA_LEN(sa) (sa)->sa_len
# else
# ifdef INET6
# ifdef AF_INET6
# define SA_LEN(sa) \
(((sa)->sa_family == AF_INET6) ? sizeof(struct sockaddr_in6) \
: sizeof(struct sockaddr))