summaryrefslogtreecommitdiff
path: root/ext/socket/mkconstants.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-21 10:50:52 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-21 10:50:52 +0000
commitdaa739876f1bbd14b043a6361e9d434d324afff5 (patch)
tree807a9e89308c79c1681d89aed801ff6478f63c5a /ext/socket/mkconstants.rb
parentcce4892c1fb4a6690e230bf90c3d7973acbf14d8 (diff)
* ext/socket: make sources rdoc friendly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/mkconstants.rb')
-rw-r--r--ext/socket/mkconstants.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/socket/mkconstants.rb b/ext/socket/mkconstants.rb
index 6df8fbe..dbcba25 100644
--- a/ext/socket/mkconstants.rb
+++ b/ext/socket/mkconstants.rb
@@ -83,7 +83,9 @@ EOS
ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_const_defs_in_guard(make_value, name, default_value)")
#if defined(<%=name%>)
+ /* <%=name%>: */
rb_define_const(rb_cSocket, <%=c_str name%>, <%=make_value%>(<%=name%>));
+ /* <%=name%>: */
rb_define_const(rb_mSockConst, <%=c_str name%>, <%=make_value%>(<%=name%>));
#endif
EOS
@@ -272,12 +274,13 @@ result = ERB.new(<<'EOS', nil, '%').result(binding)
<%= INTERN_DEFS.map {|vardef, gen_hash, decl, func| vardef }.join("\n") %>
+/*
+ * Document-module: Socket::Constants
+ */
static void
init_constants(void)
{
- /* for rdoc */
- /* rb_cSocket = rb_define_class("Socket", rb_cBasicSocket); */
- /* rb_mSockConst = rb_define_module_under(rb_cSocket, "Constants"); */
+ rb_mSockConst = rb_define_module_under(rb_cSocket, "Constants");
<%= gen_const_defs %>
<%= INTERN_DEFS.map {|vardef, gen_hash, decl, func| gen_hash }.join("\n") %>