summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--ext/socket/mkconstants.rb24
2 files changed, 8 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index 33180200607..7d030949231 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu Jan 1 21:08:34 2009 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/mkconstants.rb: check all alias possibility.
+
Thu Jan 1 20:59:55 2009 Tanaka Akira <akr@fsij.org>
* ext/socket/mkconstants.rb: more possible aliases.
diff --git a/ext/socket/mkconstants.rb b/ext/socket/mkconstants.rb
index f260d7bdefc..d3eac7f3f10 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)")