diff options
author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-10 15:00:13 +0000 |
---|---|---|
committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-10 15:00:13 +0000 |
commit | b1686c86fe0b9d10487203d510d1533994e42ebc (patch) | |
tree | f0ff994be0bebdb736a3ceaebfb1724a0e451588 /rational.c | |
parent | 330023fd85a0b13eccd2db88fb099bd46440e92b (diff) | |
download | ruby-b1686c86fe0b9d10487203d510d1533994e42ebc.tar.gz ruby-b1686c86fe0b9d10487203d510d1533994e42ebc.tar.xz ruby-b1686c86fe0b9d10487203d510d1533994e42ebc.zip |
* complex.c: avoided warnings on cpp.
* rational.c: ditto.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rational.c')
-rw-r--r-- | rational.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/rational.c b/rational.c index 3c29aab97..82628594d 100644 --- a/rational.c +++ b/rational.c @@ -377,6 +377,10 @@ f_rational_new_bang2(VALUE klass, VALUE x, VALUE y) return nurat_s_new_internal(klass, x, y); } +#ifndef RUBY_VERSION_CODE +#include "version.h" +#endif + #if RUBY_VERSION_CODE < 200 #define CANON #endif @@ -1541,9 +1545,15 @@ Init_Rational(void) rb_define_method(rb_cRational, "coerce", nurat_coerce, 1); rb_define_method(rb_cRational, "div", nurat_idiv, 1); + +#ifndef NUBY +#define NUBY 0 +#endif + #if NUBY rb_define_method(rb_cRational, "//", nurat_idiv, 1); #endif + rb_define_method(rb_cRational, "modulo", nurat_mod, 1); rb_define_method(rb_cRational, "%", nurat_mod, 1); rb_define_method(rb_cRational, "divmod", nurat_divmod, 1); |