Permalink
Browse files

* complex.c (nucomp_canonicalization): renamed.

	* ext/math/complex.c: followed the above change.

	* rational.c (nurat_canonicalization): renamed.

	* ext/math/rational.c: followed the above change.

	* configure.in: defines a new macro.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
tadf
tadf committed Dec 12, 2008
1 parent b7e026f commit 8729368f14b282cb64a7848ee515e0d4240ee57a
Showing with 29 additions and 24 deletions.
  1. +12 −0 ChangeLog
  2. +5 −10 complex.c
  3. +3 −0 configure.in
  4. +2 −2 ext/mathn/complex/complex.c
  5. +2 −2 ext/mathn/rational/rational.c
  6. +5 −10 rational.c
View
@@ -1,3 +1,15 @@
+Sat Dec 13 08:35:14 2008 Tadayoshi Funaba <tadf@dotrb.org>
+
+ * complex.c (nucomp_canonicalization): renamed.
+
+ * ext/math/complex.c: followed the above change.
+
+ * rational.c (nurat_canonicalization): renamed.
+
+ * ext/math/rational.c: followed the above change.
+
+ * configure.in: defines a new macro.
+
Sat Dec 13 01:10:03 2008 TAKAO Kouji <kouji@takao7.net>
* ext/readline/readline.c
View
@@ -320,17 +320,16 @@ f_complex_new_bang2(VALUE klass, VALUE x, VALUE y)
return nucomp_s_new_internal(klass, x, y);
}
+#ifdef CANONICALIZATION_FOR_MATHN
#define CANON
+#endif
+
#ifdef CANON
static int canonicalization = 0;
void
-nucomp_canonicalize(int f)
+nucomp_canonicalization(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
@@ -1428,11 +1427,7 @@ Init_Complex(void)
rb_undef_method(rb_cComplex, "step");
rb_undef_method(rb_cComplex, "truncate");
-#ifndef NUBY
-#define NUBY 0
-#endif
-
-#if NUBY
+#if 0 /* NUBY */
rb_undef_method(rb_cComplex, "//");
#endif
View
@@ -80,6 +80,9 @@ fi
AC_SUBST(MAJOR)
AC_SUBST(MINOR)
AC_SUBST(TEENY)
+if test "$MAJOR" = "1"; then
+ AC_DEFINE(CANONICALIZATION_FOR_MATHN)
+fi
dnl checks for alternative programs
AC_ARG_WITH(gcc, [ --without-gcc never use gcc], [
case $withval in
@@ -1,7 +1,7 @@
-extern void nucomp_canonicalize(int);
+extern void nucomp_canonicalization(int);
void
Init_complex(void)
{
- nucomp_canonicalize(1);
+ nucomp_canonicalization(1);
}
@@ -1,7 +1,7 @@
-extern void nurat_canonicalize(int);
+extern void nurat_canonicalization(int);
void
Init_rational(void)
{
- nurat_canonicalize(1);
+ nurat_canonicalization(1);
}
View
@@ -377,17 +377,16 @@ f_rational_new_bang2(VALUE klass, VALUE x, VALUE y)
return nurat_s_new_internal(klass, x, y);
}
+#ifdef CANONICALIZATION_FOR_MATHN
#define CANON
+#endif
+
#ifdef CANON
static int canonicalization = 0;
void
-nurat_canonicalize(int f)
+nurat_canonicalization(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
@@ -1543,11 +1542,7 @@ Init_Rational(void)
rb_define_method(rb_cRational, "div", nurat_idiv, 1);
-#ifndef NUBY
-#define NUBY 0
-#endif
-
-#if NUBY
+#if 0 /* NUBY */
rb_define_method(rb_cRational, "//", nurat_idiv, 1);
#endif

0 comments on commit 8729368

Please sign in to comment.