summaryrefslogtreecommitdiff
path: root/ext/socket/mkconstants.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket/mkconstants.rb')
-rw-r--r--ext/socket/mkconstants.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/socket/mkconstants.rb b/ext/socket/mkconstants.rb
index bb05250805b..589e3b2bb36 100644
--- a/ext/socket/mkconstants.rb
+++ b/ext/socket/mkconstants.rb
@@ -7,11 +7,16 @@ $out.puts("#define pseudo_AF_FTIP pseudo_AF_RTIP")
DATA.each_line do |s|
name, value = s.scan(/\S+/)
if name && name[0] != ?#
+ if name =~ /\AINADDR_/
+ define = "sock_define_uconst"
+ else
+ define = "sock_define_const"
+ end
$out.puts("#ifdef #{name}")
- $out.puts(" sock_define_const(\"#{name}\", #{name});")
+ $out.puts(" #{define}(\"#{name}\", #{name});")
if value
$out.puts("#else")
- $out.puts(" sock_define_const(\"#{name}\", #{value});")
+ $out.puts(" #{define}(\"#{name}\", #{value});")
end
$out.puts("#endif")
$out.puts