aboutsummaryrefslogtreecommitdiffstats
path: root/internal.h
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 /internal.h
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 'internal.h')
-rw-r--r--internal.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal.h b/internal.h
index dc35d31bbd..ca866d8dd5 100644
--- a/internal.h
+++ b/internal.h
@@ -780,6 +780,11 @@ struct MEMO {
#define STRING_P(s) (RB_TYPE_P((s), T_STRING) && CLASS_OF(s) == rb_cString)
+#ifdef RUBY_INTEGER_UNIFICATION
+# define rb_cFixnum rb_cInteger
+# define rb_cBignum rb_cInteger
+#endif
+
enum {
cmp_opt_Fixnum,
cmp_opt_String,