* ext/socket/mkconstants.rb: generate init_constants function.
* ext/socket/socket.c (Init_socket): call init_constants. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2b3e480bef
commit
89cf0ec1a6
@ -1,3 +1,9 @@
|
|||||||
|
Thu Jan 1 16:08:11 2009 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* ext/socket/mkconstants.rb: generate init_constants function.
|
||||||
|
|
||||||
|
* ext/socket/socket.c (Init_socket): call init_constants.
|
||||||
|
|
||||||
Thu Jan 1 16:03:04 2009 Tanaka Akira <akr@fsij.org>
|
Thu Jan 1 16:03:04 2009 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* ext/socket/mkconstants.rb (Socket::AF_INET6): moved from socket.c.
|
* ext/socket/mkconstants.rb (Socket::AF_INET6): moved from socket.c.
|
||||||
|
@ -53,6 +53,9 @@ def each_data
|
|||||||
end
|
end
|
||||||
|
|
||||||
result << ERB.new(<<'EOS', nil, '%').result(binding)
|
result << ERB.new(<<'EOS', nil, '%').result(binding)
|
||||||
|
static void
|
||||||
|
init_constants(VALUE mConst)
|
||||||
|
{
|
||||||
% each_data {|guard, define, name, default_value|
|
% each_data {|guard, define, name, default_value|
|
||||||
% if guard
|
% if guard
|
||||||
#if <%=guard%>
|
#if <%=guard%>
|
||||||
@ -69,6 +72,7 @@ result << ERB.new(<<'EOS', nil, '%').result(binding)
|
|||||||
% end
|
% end
|
||||||
|
|
||||||
% }
|
% }
|
||||||
|
}
|
||||||
EOS
|
EOS
|
||||||
|
|
||||||
if opt_o
|
if opt_o
|
||||||
|
@ -3592,6 +3592,8 @@ sock_define_uconst(const char *name, unsigned int value, VALUE mConst)
|
|||||||
#define sock_define_const(name, value) sock_define_const(name, value, mConst)
|
#define sock_define_const(name, value) sock_define_const(name, value, mConst)
|
||||||
#define sock_define_uconst(name, value) sock_define_uconst(name, value, mConst)
|
#define sock_define_uconst(name, value) sock_define_uconst(name, value, mConst)
|
||||||
|
|
||||||
|
#include "constants.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class +Socket+ provides access to the underlying operating system
|
* Class +Socket+ provides access to the underlying operating system
|
||||||
* socket implementations. It can be used to provide more operating system
|
* socket implementations. It can be used to provide more operating system
|
||||||
@ -3732,5 +3734,5 @@ Init_socket()
|
|||||||
|
|
||||||
/* constants */
|
/* constants */
|
||||||
mConst = rb_define_module_under(rb_cSocket, "Constants");
|
mConst = rb_define_module_under(rb_cSocket, "Constants");
|
||||||
#include "constants.h"
|
init_constants(mConst);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user