1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eregon 2017-12-27 16:12:47 +00:00
parent 0f989b87a0
commit a34db218ad
162 changed files with 1267 additions and 621 deletions

View file

@ -5,6 +5,10 @@
extern "C" {
#endif
static VALUE numeric_spec_size_of_VALUE(VALUE self) {
return INT2FIX(sizeof(VALUE));
}
#ifdef HAVE_NUM2CHR
static VALUE numeric_spec_NUM2CHR(VALUE self, VALUE value) {
return INT2FIX(NUM2CHR(value));
@ -17,6 +21,16 @@ static VALUE numeric_spec_rb_int2inum_14(VALUE self) {
}
#endif
#ifdef HAVE_RB_UINT2INUM
static VALUE numeric_spec_rb_uint2inum_14(VALUE self) {
return rb_uint2inum(14);
}
static VALUE numeric_spec_rb_uint2inum_n14(VALUE self) {
return rb_uint2inum(-14);
}
#endif
#ifdef HAVE_RB_INTEGER
static VALUE numeric_spec_rb_Integer(VALUE self, VALUE str) {
return rb_Integer(str);
@ -106,6 +120,8 @@ void Init_numeric_spec(void) {
VALUE cls;
cls = rb_define_class("CApiNumericSpecs", rb_cObject);
rb_define_method(cls, "size_of_VALUE", numeric_spec_size_of_VALUE, 0);
#ifdef HAVE_NUM2CHR
rb_define_method(cls, "NUM2CHR", numeric_spec_NUM2CHR, 1);
#endif
@ -114,6 +130,11 @@ void Init_numeric_spec(void) {
rb_define_method(cls, "rb_int2inum_14", numeric_spec_rb_int2inum_14, 0);
#endif
#ifdef HAVE_RB_UINT2INUM
rb_define_method(cls, "rb_uint2inum_14", numeric_spec_rb_uint2inum_14, 0);
rb_define_method(cls, "rb_uint2inum_n14", numeric_spec_rb_uint2inum_n14, 0);
#endif
#ifdef HAVE_RB_INTEGER
rb_define_method(cls, "rb_Integer", numeric_spec_rb_Integer, 1);
#endif

View file

@ -409,6 +409,7 @@
#define HAVE_NUM2CHR 1
#define HAVE_RB_CMPINT 1
#define HAVE_RB_INT2INUM 1
#define HAVE_RB_UINT2INUM 1
#define HAVE_RB_INTEGER 1
#define HAVE_RB_LL2INUM 1
#define HAVE_RB_NUM2DBL 1