aboutsummaryrefslogtreecommitdiffstats
path: root/bignum.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-13 11:34:56 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-13 11:34:56 +0000
commitb070762a9e7d7594af03c7efa68d6593f3e60e55 (patch)
tree26c5f7135a20e184d000c238d6e52184f7ad6721 /bignum.c
parent10fb06aa8bf08177eb5c31fa45374c573a84a22a (diff)
downloadruby-b070762a9e7d7594af03c7efa68d6593f3e60e55.tar.gz
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 'bignum.c')
-rw-r--r--bignum.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/bignum.c b/bignum.c
index d1e10b95c3..767659d046 100644
--- a/bignum.c
+++ b/bignum.c
@@ -31,7 +31,9 @@
#define RB_BIGNUM_TYPE_P(x) RB_TYPE_P((x), T_BIGNUM)
+#ifndef RUBY_INTEGER_UNIFICATION
VALUE rb_cBignum;
+#endif
const char ruby_digitmap[] = "0123456789abcdefghijklmnopqrstuvwxyz";
#ifndef SIZEOF_BDIGIT_DBL
@@ -6783,7 +6785,9 @@ rb_big_even_p(VALUE num)
void
Init_Bignum(void)
{
+#ifndef RUBY_INTEGER_UNIFICATION
rb_cBignum = rb_cInteger;
+#endif
rb_define_const(rb_cObject, "Bignum", rb_cInteger);
rb_define_method(rb_cInteger, "coerce", rb_int_coerce, 1);