зеркало из https://github.com/github/ruby.git
* ext/socket/extconf.rb: test IPPROTO_IP and IPPROTO_IPV6 constants.
* ext/socket/mkconstants.rb: define macros for enum. [ruby-dev:38849] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
709bff4f2b
Коммит
01cd3467fb
|
@ -1,3 +1,11 @@
|
|||
Tue May 11 23:07:22 2010 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/socket/extconf.rb: test IPPROTO_IP and IPPROTO_IPV6 constants.
|
||||
|
||||
* ext/socket/mkconstants.rb: define macros for enum.
|
||||
|
||||
[ruby-dev:38849]
|
||||
|
||||
Tue May 11 21:53:18 2010 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* test/rake/test_task_arguments.rb: makes ENV empty during tests
|
||||
|
|
|
@ -110,6 +110,13 @@ end
|
|||
have_header("netinet/tcp.h") if /cygwin/ !~ RUBY_PLATFORM # for cygwin 1.1.5
|
||||
have_header("netinet/udp.h")
|
||||
|
||||
%w[
|
||||
IPPROTO_IP
|
||||
IPPROTO_IPV6
|
||||
].each {|name|
|
||||
have_const(name, headers)
|
||||
}
|
||||
|
||||
if (have_func("sendmsg") | have_func("recvmsg")) && /64-darwin/ !~ RUBY_PLATFORM
|
||||
# CMSG_ macros are broken on 64bit darwin, because of use of __DARWIN_ALIGN.
|
||||
have_struct_member('struct msghdr', 'msg_control', ['sys/types.h', 'sys/socket.h'])
|
||||
|
|
|
@ -73,11 +73,15 @@ end
|
|||
|
||||
ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_const_decls")
|
||||
% each_const {|guard, make_value, name, default_value|
|
||||
% if default_value
|
||||
#ifndef <%=name%>
|
||||
# define <%=name%> <%=default_value%>
|
||||
#if !defined(<%=name%>)
|
||||
# if defined(HAVE_CONST_<%=name.upcase%>)
|
||||
# define <%=name%> <%=name%>
|
||||
%if default_value
|
||||
# else
|
||||
# define <%=name%> <%=default_value%>
|
||||
%end
|
||||
# endif
|
||||
#endif
|
||||
% end
|
||||
% }
|
||||
EOS
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче