summaryrefslogtreecommitdiffstats
path: root/complex.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-16 10:25:24 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-16 10:25:24 +0000
commit2246374843c1fd709ac287b4502bd260881ed81c (patch)
treefa8939fab5a293b1ea801973230fff503a00b12e /complex.c
parent91444cbad7435ccd4699bf5f0a1ec285958c6530 (diff)
merges r20653 and r20667 from trunk into ruby_1_9_1.
* complex.c, rational.c: do not use RUBY_VERSION_CODE. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@20786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'complex.c')
-rw-r--r--complex.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/complex.c b/complex.c
index 6dc09526d..0549bab87 100644
--- a/complex.c
+++ b/complex.c
@@ -320,20 +320,17 @@ f_complex_new_bang2(VALUE klass, VALUE x, VALUE y)
return nucomp_s_new_internal(klass, x, y);
}
-#ifndef RUBY_VERSION_CODE
-#include "version.h"
-#endif
-
-#if RUBY_VERSION_CODE < 200
#define CANON
-#endif
-
#ifdef CANON
static int canonicalization = 0;
void
nucomp_canonicalize(int f)
{
+ VALUE s = rb_const_get(rb_cObject, rb_intern("RUBY_VERSION"));
+ Check_Type(s, T_STRING);
+ if (rb_str_cmp(s, rb_str_new2("2.0.0")) >= 0)
+ rb_bug("no longer provide canonicalization");
canonicalization = f;
}
#endif