diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-06-13 11:34:56 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-06-13 11:34:56 +0000 |
commit | c071c052292168592de091cdb4c22dc3fbfd1af1 (patch) | |
tree | 26c5f7135a20e184d000c238d6e52184f7ad6721 /numeric.c | |
parent | ed75b6b4b024650654a5ff5eae2c02482e3a011c (diff) |
Integer unification macro
* include/ruby/ruby.h (RUBY_INTEGER_UNIFICATION): macro to tell if
Integer is integrated. [ruby-core:75718][Bug #12427]
* include/ruby/backward.h, internal.h (rb_cFixnum, rb_cBignum):
fallback to rb_cInteger.
* bignum.c, numeric.c, ext/json/generator/generator.{c,h}: use the
macro.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -111,7 +111,9 @@ static ID id_coerce, id_div, id_divmod; VALUE rb_cNumeric; VALUE rb_cFloat; VALUE rb_cInteger; +#ifndef RUBY_INTEGER_UNIFICATION VALUE rb_cFixnum; +#endif VALUE rb_eZeroDivError; VALUE rb_eFloatDomainError; @@ -4957,7 +4959,9 @@ Init_Numeric(void) rb_define_method(rb_cInteger, "size", int_size, 0); rb_define_method(rb_cInteger, "bit_length", rb_int_bit_length, 0); +#ifndef RUBY_INTEGER_UNIFICATION rb_cFixnum = rb_cInteger; +#endif rb_define_const(rb_cObject, "Fixnum", rb_cInteger); rb_cFloat = rb_define_class("Float", rb_cNumeric); |