summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwyhaines <wyhaines@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-27 14:58:36 +0000
committerwyhaines <wyhaines@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-27 14:58:36 +0000
commit96d07f510a12323095a237ba34ef4dcb8fee566b (patch)
treec96946b9d51abbb09ae917ce34e4facd06a48eaa
parente341e9b035294d1acf5347620fbd2fcb9245d382 (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
-rw-r--r--ChangeLog5
-rw-r--r--re.h1
-rw-r--r--ruby.h12
3 files changed, 17 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index c545614f32..3da694e87f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
Wed Jan 27 22:16:00 2010 Kirk Haines <khaines@ruby-lang.org>
- * io.c: Backport #1818 [ruby-core:24561]; (argf_eof): go to the next file if called after ARGF.close or ARGF.skip.
+ * re.h: Backport #1875 [ruby-core:24735]; (RMATCH_REGS): added for compatibility.
+ ruby.h: (RFLOAT_VALUE, RSTRING_END, RREGEXP_SRC_*, RBIGNUM_*): backported macros for compatiblity from trunk.
+
+ * io.c: Backport #1818 [ruby-core:24561]; (argf_eof): go to the next file if called after ARGF.close or ARGF.skip. r26451
* lib/rexml/text.rb: Backport #1806 [ruby-core:24506]; (REXML::Text.normalize): call to_s for input. r26442
diff --git a/re.h b/re.h
index 45b2753dd5..3b3380bd80 100644
--- a/re.h
+++ b/re.h
@@ -27,6 +27,7 @@ struct RMatch {
};
#define RMATCH(obj) (R_CAST(RMatch)(obj))
+#define RMATCH_REGS(obj) (R_CAST(RMatch)(obj)->regs
VALUE rb_reg_regcomp _((VALUE));
long rb_reg_search _((VALUE, VALUE, long, long));
diff --git a/ruby.h b/ruby.h
index 2701f0dc77..684b8de7aa 100644
--- a/ruby.h
+++ b/ruby.h
@@ -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))