summaryrefslogtreecommitdiff
path: root/rational.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-10 05:05:50 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-10 05:05:50 (GMT)
commit9c060a59b42f038e55e8b3662ae6a8db99fae67d (patch)
tree01a0ae24d65bb97f78fd99ce6df2742e076df1eb /rational.c
parent67129c8383f382eddd805411ef619d5c8c258dc3 (diff)
rational.c: conditionally defined variable
* rational.c (numeric_quo): variable 'canonicalization' is defined conditionally by CANON (and CANONICALIZATION_FOR_MATHN). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rational.c')
-rw-r--r--rational.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/rational.c b/rational.c
index 1582f11..652f5ac 100644
--- a/rational.c
+++ b/rational.c
@@ -494,6 +494,8 @@ nurat_canonicalization(int f)
{
canonicalization = f;
}
+#else
+# define canonicalization <<<No canonicalization>>>
#endif
inline static void
@@ -1867,10 +1869,13 @@ numeric_quo(VALUE x, VALUE y)
return f_fdiv(x, y);
}
+#ifdef CANON
if (canonicalization) {
x = rb_rational_raw1(x);
}
- else {
+ else
+#endif
+ {
x = rb_convert_type(x, T_RATIONAL, "Rational", "to_r");
}
return rb_funcall(x, '/', 1, y);