ruby-changes:64691
From: Nobuyoshi <ko1@a...>
Date: Thu, 31 Dec 2020 18:20:56 +0900 (JST)
Subject: [ruby-changes:64691] d5fb51d2d3 (master): Add time.rb as builtin
https://git.ruby-lang.org/ruby.git/commit/?id=d5fb51d2d3 From d5fb51d2d3a7ba0e16042282d0f94c5336ed2cc1 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Wed, 30 Dec 2020 01:45:59 +0900 Subject: Add time.rb as builtin diff --git a/common.mk b/common.mk index 0f165ba..671151a 100644 --- a/common.mk +++ b/common.mk @@ -1028,6 +1028,7 @@ BUILTIN_RB_SRCS = \ https://github.com/ruby/ruby/blob/trunk/common.mk#L1028 $(srcdir)/array.rb \ $(srcdir)/kernel.rb \ $(srcdir)/ractor.rb \ + $(srcdir)/time.rb \ $(srcdir)/prelude.rb \ $(srcdir)/gem_prelude.rb \ $(empty) @@ -8386,6 +8387,7 @@ miniinit.$(OBJEXT): {$(VPATH)}st.h https://github.com/ruby/ruby/blob/trunk/common.mk#L8387 miniinit.$(OBJEXT): {$(VPATH)}subst.h miniinit.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h miniinit.$(OBJEXT): {$(VPATH)}thread_native.h +miniinit.$(OBJEXT): {$(VPATH)}time.rb miniinit.$(OBJEXT): {$(VPATH)}trace_point.rb miniinit.$(OBJEXT): {$(VPATH)}vm_core.h miniinit.$(OBJEXT): {$(VPATH)}vm_opts.h @@ -14269,6 +14271,7 @@ time.$(OBJEXT): {$(VPATH)}backward/2/limits.h https://github.com/ruby/ruby/blob/trunk/common.mk#L14271 time.$(OBJEXT): {$(VPATH)}backward/2/long_long.h time.$(OBJEXT): {$(VPATH)}backward/2/stdalign.h time.$(OBJEXT): {$(VPATH)}backward/2/stdarg.h +time.$(OBJEXT): {$(VPATH)}builtin.h time.$(OBJEXT): {$(VPATH)}config.h time.$(OBJEXT): {$(VPATH)}constant.h time.$(OBJEXT): {$(VPATH)}defines.h @@ -14424,6 +14427,7 @@ time.$(OBJEXT): {$(VPATH)}ruby_assert.h https://github.com/ruby/ruby/blob/trunk/common.mk#L14427 time.$(OBJEXT): {$(VPATH)}st.h time.$(OBJEXT): {$(VPATH)}subst.h time.$(OBJEXT): {$(VPATH)}time.c +time.$(OBJEXT): {$(VPATH)}time.rbinc time.$(OBJEXT): {$(VPATH)}timev.h transcode.$(OBJEXT): $(hdrdir)/ruby.h transcode.$(OBJEXT): $(hdrdir)/ruby/ruby.h diff --git a/inits.c b/inits.c index f636748..ad3705d 100644 --- a/inits.c +++ b/inits.c @@ -96,6 +96,7 @@ rb_call_builtin_inits(void) https://github.com/ruby/ruby/blob/trunk/inits.c#L96 BUILTIN(warning); BUILTIN(array); BUILTIN(kernel); + BUILTIN(time); Init_builtin_prelude(); } #undef CALL diff --git a/time.c b/time.c index d8f3b6a..6104596 100644 --- a/time.c +++ b/time.c @@ -43,6 +43,8 @@ https://github.com/ruby/ruby/blob/trunk/time.c#L43 #include "ruby/encoding.h" #include "timev.h" +#include "builtin.h" + static ID id_submicro, id_nano_num, id_nano_den, id_offset, id_zone; static ID id_nanosecond, id_microsecond, id_millisecond, id_nsec, id_usec; static ID id_local_to_utc, id_utc_to_local, id_find_timezone; @@ -5944,4 +5946,7 @@ Init_Time(void) https://github.com/ruby/ruby/blob/trunk/time.c#L5946 #endif rb_cTimeTM = Init_tm(rb_cTime, "tm"); + if (0) get_tmopt(Qnil, NULL); } + +#include "time.rbinc" diff --git a/time.rb b/time.rb new file mode 100644 index 0000000..792d600 --- /dev/null +++ b/time.rb @@ -0,0 +1 @@ +# -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/