なかだです。

RUBY_*の定数はRubyモジュールを作ってそこに移したほうがいいんじゃ
ないか、という話は以前から何度か出ていますが、どうでしょうか。

あと、ruby --copyrightが1993-2003のままになってます。


* version.c (Init_version): define constants under module Ruby.


Index: common.mk =================================================================== RCS file: /cvs/ruby/src/ruby/common.mk,v retrieving revision 1.2 diff -u -2 -p -d -r1.2 common.mk --- common.mk 23 Mar 2004 05:32:00 -0000 1.2 +++ common.mk 25 Mar 2004 09:21:03 -0000 @@ -197,5 +197,5 @@ enum.$(OBJEXT): {$(VPATH)}enum.c {$(VPAT error.$(OBJEXT): {$(VPATH)}error.c {$(VPATH)}ruby.h config.h \ {$(VPATH)}defines.h {$(VPATH)}intern.h {$(VPATH)}missing.h \ - {$(VPATH)}env.h {$(VPATH)}version.h {$(VPATH)}st.h + {$(VPATH)}env.h {$(VPATH)}st.h euc_jp.$(OBJEXT): {$(VPATH)}euc_jp.c {$(VPATH)}regenc.h \ {$(VPATH)}oniguruma.h Index: error.c =================================================================== RCS file: /cvs/ruby/src/ruby/error.c,v retrieving revision 1.94 diff -u -2 -p -d -r1.94 error.c --- error.c 16 Mar 2004 23:03:15 -0000 1.94 +++ error.c 25 Mar 2004 09:18:44 -0000 @@ -13,5 +13,4 @@ #include "ruby.h" #include "env.h" -#include "version.h" #include "st.h" @@ -25,4 +24,6 @@ #endif +extern const char ruby_version[], ruby_release_date[], ruby_platform[]; + int ruby_nerrs; @@ -203,5 +204,5 @@ rb_bug(fmt, va_alist) va_end(args); fprintf(out, "\nruby %s (%s) [%s]\n\n", - RUBY_VERSION, RUBY_RELEASE_DATE, RUBY_PLATFORM); + ruby_version, ruby_release_date, ruby_platform); } abort(); Index: version.c =================================================================== RCS file: /cvs/ruby/src/ruby/version.c,v retrieving revision 1.9 diff -u -2 -p -d -r1.9 version.c --- version.c 22 Jan 2004 08:31:33 -0000 1.9 +++ version.c 25 Mar 2004 09:18:47 -0000 @@ -15,14 +15,25 @@ #include <stdio.h> +VALUE rb_mRuby; + +const char ruby_version[] = RUBY_VERSION; +const char ruby_release_date[] = RUBY_RELEASE_DATE; +const char ruby_platform[] = RUBY_PLATFORM; + void Init_version() { - VALUE v = rb_obj_freeze(rb_str_new2(RUBY_VERSION)); - VALUE d = rb_obj_freeze(rb_str_new2(RUBY_RELEASE_DATE)); - VALUE p = rb_obj_freeze(rb_str_new2(RUBY_PLATFORM)); + VALUE v = rb_obj_freeze(rb_str_new2(ruby_version)); + VALUE d = rb_obj_freeze(rb_str_new2(ruby_release_date)); + VALUE p = rb_obj_freeze(rb_str_new2(ruby_platform)); rb_define_global_const("RUBY_VERSION", v); rb_define_global_const("RUBY_RELEASE_DATE", d); rb_define_global_const("RUBY_PLATFORM", p); + + rb_mRuby = rb_define_module("Ruby"); + rb_define_const(rb_mRuby, "VERSION", v); + rb_define_const(rb_mRuby, "RELEASE_DATE", d); + rb_define_const(rb_mRuby, "PLATFORM", p); } @@ -36,5 +47,5 @@ void ruby_show_copyright() { - printf("ruby - Copyright (C) 1993-2003 Yukihiro Matsumoto\n"); + printf("ruby - Copyright (C) 1993-%d Yukihiro Matsumoto\n", RUBY_RELEASE_YEAR); exit(0); }
-- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦