summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-17 16:37:41 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-17 16:37:41 +0000
commite56d2c385aac51298b34edf3fe4fddde512aec1b (patch)
tree1fe3a1e04ba6de9c6e528f77cd4477c4ffe7c65e /include
parentfb8f7259c3435ac01ff9ac2718d325e7c309336b (diff)
* include/ruby/ruby.h: Hide Rational internal.
(RRational): Moved to internal.h (RRATIONAL): Ditto. (RRATIONAL_SET_NUM): Moved to rational.c. (RRATIONAL_SET_DEN): Ditto. * rational.c (rb_rational_num): New function. (rb_rational_den): Ditto. * include/ruby/intern.h (rb_rational_num): Declared. (rb_rational_den): Ditto. * ext/bigdecimal/bigdecimal.c: Follow the above change. * ext/date/date_core.c: Ditto. [ruby-core:60665] [Feature #9513] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r--include/ruby/intern.h2
-rw-r--r--include/ruby/ruby.h10
2 files changed, 2 insertions, 10 deletions
diff --git a/include/ruby/intern.h b/include/ruby/intern.h
index f36f192..387f000 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -168,6 +168,8 @@ VALUE rb_rational_new(VALUE, VALUE);
VALUE rb_Rational(VALUE, VALUE);
#define rb_Rational1(x) rb_Rational((x), INT2FIX(1))
#define rb_Rational2(x,y) rb_Rational((x), (y))
+VALUE rb_rational_num(VALUE rat);
+VALUE rb_rational_den(VALUE rat);
VALUE rb_flt_rationalize_with_prec(VALUE, VALUE);
VALUE rb_flt_rationalize(VALUE);
/* complex.c */
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 54fa9f1..a39b958 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -943,15 +943,6 @@ struct RFile {
struct rb_io_t *fptr;
};
-struct RRational {
- struct RBasic basic;
- const VALUE num;
- const VALUE den;
-};
-
-#define RRATIONAL_SET_NUM(rat, n) RB_OBJ_WRITE((rat), &((struct RRational *)(rat))->num,(n))
-#define RRATIONAL_SET_DEN(rat, d) RB_OBJ_WRITE((rat), &((struct RRational *)(rat))->den,(d))
-
struct RComplex {
struct RBasic basic;
const VALUE real;
@@ -1101,7 +1092,6 @@ struct RStruct {
#define RTYPEDDATA(obj) (R_CAST(RTypedData)(obj))
#define RSTRUCT(obj) (R_CAST(RStruct)(obj))
#define RFILE(obj) (R_CAST(RFile)(obj))
-#define RRATIONAL(obj) (R_CAST(RRational)(obj))
#define RCOMPLEX(obj) (R_CAST(RComplex)(obj))
#define RSYMBOL(obj) (R_CAST(RSymbol)(obj))