diff options
author | wyhaines <wyhaines@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-27 14:58:36 +0000 |
---|---|---|
committer | wyhaines <wyhaines@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-27 14:58:36 +0000 |
commit | 96d07f510a12323095a237ba34ef4dcb8fee566b (patch) | |
tree | c96946b9d51abbb09ae917ce34e4facd06a48eaa /ruby.h | |
parent | e341e9b035294d1acf5347620fbd2fcb9245d382 (diff) |
Backport #1875 [ruby-core:24735]; (RMATCH_REGS): added for compatibility.
(RFLOAT_VALUE, RSTRING_END, RREGEXP_SRC_*, RBIGNUM_*): backported macros for compatiblity from trunk.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@26452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.h')
-rw-r--r-- | ruby.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -335,6 +335,8 @@ struct RFloat { double value; }; +#define RFLOAT_VALUE(v) (RFLOAT(v)->value) + #define ELTS_SHARED FL_USER2 struct RString { @@ -348,6 +350,7 @@ struct RString { }; #define RSTRING_PTR(s) (RSTRING(s)->ptr) #define RSTRING_LEN(s) (RSTRING(s)->len) +#define RSTRING_END(s) (RSTRING_PTR(s)+RSTRING_LEN(s)) struct RArray { struct RBasic basic; @@ -367,6 +370,8 @@ struct RRegexp { long len; char *str; }; +#define RREGEXP_SRC_PTR(r) (RREGEXP(r)->src) +#define RREGEXP_SRC_LEN(r) (RREGEXP(r)->len) struct RHash { struct RBasic basic; @@ -424,6 +429,13 @@ struct RBignum { long len; void *digits; }; +#define RBIGNUM_SIGN(b) (RBIGNUM(b)->sign) +#define RBIGNUM_SET_SIGN(b,s) (RBIGNUM(b)->sign = (s)) +#define RBIGNUM_POSITIVE_P(b) RBIGNUM_SIGN(b) +#define RBIGNUM_NEGATIVE_P(b) (!RBIGNUM_SIGN(b)) +#define RBIGNUM_LEN(b) (RBIGNUM(b)->len) +#define RBIGNUM_DIGITS(b) (RBIGNUM(b)->digits) + #define R_CAST(st) (struct st*) #define RBASIC(obj) (R_CAST(RBasic)(obj)) |