From e56d2c385aac51298b34edf3fe4fddde512aec1b Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 17 May 2014 16:37:41 +0000 Subject: * 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 --- include/ruby/intern.h | 2 ++ include/ruby/ruby.h | 10 ---------- 2 files changed, 2 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/ruby/intern.h b/include/ruby/intern.h index f36f19214d..387f000c66 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 54fa9f121d..a39b958617 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)) -- cgit v1.2.3