mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/date/date_core.c (DAY_IN_NANOSECONDS): long long int is not
available on all platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6410a4ae27
commit
66fc78d207
2 changed files with 13 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
Thu May 5 22:09:39 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ext/date/date_core.c (DAY_IN_NANOSECONDS): long long int is not
|
||||
available on all platforms.
|
||||
|
||||
Thu May 5 17:36:31 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
|
||||
|
||||
* eval.c (frame_func_id): store result of method_entry_of_iseq() to
|
||||
|
|
|
@ -42,7 +42,13 @@
|
|||
|
||||
#define DAY_IN_SECONDS 86400
|
||||
#define SECOND_IN_NANOSECONDS 1000000000
|
||||
#define DAY_IN_NANOSECONDS 86400000000000LL
|
||||
#if (ULONG_MAX / DAY_IN_SECONDS) > SECOND_IN_NANOSECONDS
|
||||
#define DAY_IN_NANOSECONDS LONG2NUM(DAY_IN_SECONDS * SECOND_IN_NANOSECONDS)
|
||||
#elif defined HAVE_LONG_LONG
|
||||
#define DAY_IN_NANOSECONDS LL2NUM((LONG_LONG)DAY_IN_SECONDS * SECOND_IN_NANOSECONDS)
|
||||
#else
|
||||
#define DAY_IN_NANOSECONDS f_mul(INT2FIX(DAY_IN_SECONDS), INT2FIX(SECOND_IN_NANOSECONDS))
|
||||
#endif
|
||||
|
||||
/* copied from time.c */
|
||||
#define NDIV(x,y) (-(-((x)+1)/(y))-1)
|
||||
|
@ -4584,7 +4590,7 @@ Init_date_core(void)
|
|||
|
||||
rzero = rb_rational_new1(INT2FIX(0));
|
||||
rhalf = rb_rational_new2(INT2FIX(1), INT2FIX(2));
|
||||
day_in_nanoseconds = rb_ll2inum(DAY_IN_NANOSECONDS);
|
||||
day_in_nanoseconds = DAY_IN_NANOSECONDS;
|
||||
|
||||
rb_gc_register_mark_object(rzero);
|
||||
rb_gc_register_mark_object(rhalf);
|
||||
|
|
Loading…
Reference in a new issue