diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-16 05:34:48 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-16 05:34:48 +0000 |
commit | 0bb75c4a714bae4a50358b8161e1bcc1e00cf144 (patch) | |
tree | 6190a89d655571cd4aefd587b61b2ce1f10eb8ee /include/ruby/ruby.h | |
parent | 10a8e87ce579d7c6d73acdf0d37403902a4f372d (diff) | |
download | ruby-0bb75c4a714bae4a50358b8161e1bcc1e00cf144.tar.gz |
* include/ruby/ruby.h (RBIGNUM_SIGN): Defined for compatibility.
(RBIGNUM_POSITIVE_P): Ditto.
(RBIGNUM_NEGATIVE_P): Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby/ruby.h')
-rw-r--r-- | include/ruby/ruby.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 07477b0da4..3394b8c7f9 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -1069,6 +1069,10 @@ struct RStruct { #define RSTRUCT_SET(st, idx, v) RB_OBJ_WRITE(st, &RSTRUCT_CONST_PTR(st)[idx], (v)) #define RSTRUCT_GET(st, idx) (RSTRUCT_CONST_PTR(st)[idx]) +#define RBIGNUM_SIGN(b) (FIX2INT(rb_big_cmp((b), INT2FIX(0))) >= 0) +#define RBIGNUM_POSITIVE_P(b) (FIX2INT(rb_big_cmp((b), INT2FIX(0))) >= 0) +#define RBIGNUM_NEGATIVE_P(b) (FIX2INT(rb_big_cmp((b), INT2FIX(0))) < 0) + #define R_CAST(st) (struct st*) #define RBASIC(obj) (R_CAST(RBasic)(obj)) #define ROBJECT(obj) (R_CAST(RObject)(obj)) |