ruby-changes:9697
From: akr <ko1@a...>
Date: Thu, 1 Jan 2009 16:09:33 +0900 (JST)
Subject: [ruby-changes:9697] Ruby:r21238 (trunk): * ext/socket/mkconstants.rb: generate init_constants function.
akr 2009-01-01 16:09:19 +0900 (Thu, 01 Jan 2009) New Revision: 21238 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21238 Log: * ext/socket/mkconstants.rb: generate init_constants function. * ext/socket/socket.c (Init_socket): call init_constants. Modified files: trunk/ChangeLog trunk/ext/socket/mkconstants.rb trunk/ext/socket/socket.c Index: ChangeLog =================================================================== --- ChangeLog (revision 21237) +++ ChangeLog (revision 21238) @@ -1,3 +1,9 @@ +Thu Jan 1 16:08:11 2009 Tanaka Akira <akr@f...> + + * 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@f...> * ext/socket/mkconstants.rb (Socket::AF_INET6): moved from socket.c. Index: ext/socket/mkconstants.rb =================================================================== --- ext/socket/mkconstants.rb (revision 21237) +++ ext/socket/mkconstants.rb (revision 21238) @@ -53,6 +53,9 @@ end result << ERB.new(<<'EOS', nil, '%').result(binding) +static void +init_constants(VALUE mConst) +{ % each_data {|guard, define, name, default_value| % if guard #if <%=guard%> @@ -69,6 +72,7 @@ % end % } +} EOS if opt_o Index: ext/socket/socket.c =================================================================== --- ext/socket/socket.c (revision 21237) +++ ext/socket/socket.c (revision 21238) @@ -3592,6 +3592,8 @@ #define sock_define_const(name, value) sock_define_const(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 * socket implementations. It can be used to provide more operating system @@ -3732,5 +3734,5 @@ /* constants */ mConst = rb_define_module_under(rb_cSocket, "Constants"); -#include "constants.h" + init_constants(mConst); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/