ruby-changes:9337
From: yugui <ko1@a...>
Date: Fri, 19 Dec 2008 20:37:23 +0900 (JST)
Subject: [ruby-changes:9337] Ruby:r20874 (ruby_1_9_1): merges r20683 from trunk into ruby_1_9_1.
yugui 2008-12-19 20:36:56 +0900 (Fri, 19 Dec 2008) New Revision: 20874 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20874 Log: merges r20683 from trunk into ruby_1_9_1. * 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. Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/complex.c branches/ruby_1_9_1/configure.in branches/ruby_1_9_1/ext/mathn/complex/complex.c branches/ruby_1_9_1/ext/mathn/rational/rational.c branches/ruby_1_9_1/rational.c Index: ruby_1_9_1/complex.c =================================================================== --- ruby_1_9_1/complex.c (revision 20873) +++ ruby_1_9_1/complex.c (revision 20874) @@ -320,17 +320,16 @@ 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 @@ 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 Index: ruby_1_9_1/configure.in =================================================================== --- ruby_1_9_1/configure.in (revision 20873) +++ ruby_1_9_1/configure.in (revision 20874) @@ -80,6 +80,9 @@ 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 Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 20873) +++ ruby_1_9_1/ChangeLog (revision 20874) @@ -1,3 +1,15 @@ +Sat Dec 13 08:35:14 2008 Tadayoshi Funaba <tadf@d...> + + * 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. + Wed Dec 17 15:44:28 2008 Yukihiro Matsumoto <matz@r...> * array.c (rb_ary_pop_m): use enum ary_take_pos_flags. Index: ruby_1_9_1/ext/mathn/complex/complex.c =================================================================== --- ruby_1_9_1/ext/mathn/complex/complex.c (revision 20873) +++ ruby_1_9_1/ext/mathn/complex/complex.c (revision 20874) @@ -1,7 +1,7 @@ -extern void nucomp_canonicalize(int); +extern void nucomp_canonicalization(int); void Init_complex(void) { - nucomp_canonicalize(1); + nucomp_canonicalization(1); } Index: ruby_1_9_1/ext/mathn/rational/rational.c =================================================================== --- ruby_1_9_1/ext/mathn/rational/rational.c (revision 20873) +++ ruby_1_9_1/ext/mathn/rational/rational.c (revision 20874) @@ -1,7 +1,7 @@ -extern void nurat_canonicalize(int); +extern void nurat_canonicalization(int); void Init_rational(void) { - nurat_canonicalize(1); + nurat_canonicalization(1); } Index: ruby_1_9_1/rational.c =================================================================== --- ruby_1_9_1/rational.c (revision 20873) +++ ruby_1_9_1/rational.c (revision 20874) @@ -377,17 +377,16 @@ 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 @@ 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/