From 28c2711230240fde0a9f66effbbd71108b4b0dfd Mon Sep 17 00:00:00 2001 From: akr Date: Thu, 1 Jan 2009 19:43:49 +0000 Subject: * ext/socket/mkconstants.rb: check duplicates. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 16 ++++++++++------ ext/socket/mkconstants.rb | 6 ++++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index f530f0080a..145ee91950 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Fri Jan 2 04:40:00 2009 Tanaka Akira + + * ext/socket/mkconstants.rb: check duplicates. + Fri Jan 2 02:39:08 2009 Tanaka Akira * ext/socket/socket.c (optname_arg): defined. @@ -113,7 +117,7 @@ Thu Jan 1 16:48:07 2009 Tanaka Akira Thu Jan 1 15:08:46 2009 Yuki Sonoda (Yugui) - * tool/flie2lastrev.rb: supports git repositories which are cloned + * tool/file2lastrev.rb: supports git repositories which are cloned from a git-svn gateway. Patch by Hongli Lai. [ruby-core:21020] @@ -341,7 +345,7 @@ Mon Dec 29 17:25:17 2008 Yuki Sonoda (Yugui) * bin/erb.rb (ERB::Main.run): adds -E and -U options. String is no longer Enumerable. - * man/erb.1: new manapage. + * man/erb.1: new manpage. * test/erb/test_erb_m17n.rb: new test case for m17n features. @@ -470,10 +474,10 @@ Sun Dec 28 00:43:33 2008 Tanaka Akira Sat Dec 27 22:41:02 2008 Nobuyoshi Nakada - * test/rdoc/test_rdoc_info_formatting.rb (setup, teadown): uses - mktmpdir and removes it alfter the test. + * test/rdoc/test_rdoc_info_formatting.rb (setup, teardown): uses + mktmpdir and removes it after the test. - * test/cgi/test_cgi_session.rb (setup, teadown): ditto. + * test/cgi/test_cgi_session.rb (setup, teardown): ditto. Sat Dec 27 21:46:10 2008 TAKANO Mitsuhiro (takano32) @@ -554,7 +558,7 @@ Sat Dec 27 14:29:33 2008 Tanaka Akira Sat Dec 27 13:36:55 2008 Koichi Sasada * eval.c (get_errinfo): return th->errinfo value - if normal errinfo place (dynamic local viriable) is not found. + if normal errinfo place (dynamic local variable) is not found. fixes Bug #732 [ruby-dev:37046]. * bootstraptest/test_proc.rb: add a test. diff --git a/ext/socket/mkconstants.rb b/ext/socket/mkconstants.rb index 318ffde678..82718b400e 100644 --- a/ext/socket/mkconstants.rb +++ b/ext/socket/mkconstants.rb @@ -34,12 +34,14 @@ result = '' # workaround for NetBSD, OpenBSD and etc. result << "#define pseudo_AF_FTIP pseudo_AF_RTIP\n" -DEFS = [] +h = {} DATA.each_line {|s| name, default_value = s.scan(/\S+/) next unless name && name[0] != ?# - DEFS << [name, default_value] + raise "duplicate name: #{name}" if h.has_key? name + h[name] = default_value } +DEFS = h.to_a def each_const DEFS.each {|name, default_value| -- cgit v1.2.3