summaryrefslogtreecommitdiff
path: root/ext/socket
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-01 12:09:34 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-01 12:09:34 +0000
commit85d13f6165ece405b66f6c4d6771043375830c1e (patch)
tree3b46ac15a67c418ecbdcb12b225d9fc3610232f4 /ext/socket
parent48649d21c91a9e626ddd9d341540afb1e465953f (diff)
* ext/socket/mkconstants.rb: check all alias possibility.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket')
-rw-r--r--ext/socket/mkconstants.rb24
1 files changed, 4 insertions, 20 deletions
diff --git a/ext/socket/mkconstants.rb b/ext/socket/mkconstants.rb
index f260d7bdef..d3eac7f3f1 100644
--- a/ext/socket/mkconstants.rb
+++ b/ext/socket/mkconstants.rb
@@ -93,28 +93,12 @@ ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_name_to_int(str_var, len_var,
}
EOS
-MAYBE_ALIAS = [
- ["AF_UNIX", "AF_LOCAL"],
- ["AF_ISO", "AF_OSI"],
- ["AF_E164", "AF_ISDN"],
- ["AF_NS", "AF_IPX"],
-]
-
def each_alias(pat)
- h = {}
- each_name(pat) {|name|
- h[name] = [name]
- }
- MAYBE_ALIAS.each {|names|
- a = []
- names.each {|n|
- a << n if h.delete n
- }
- h[a.first] = a
- }
- h.each_value {|names|
- yield names
+ names = []
+ each_name(pat) {|n|
+ names << n
}
+ yield names
end
ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_int_to_name(int_var, pat)")