1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
tadf 2008-12-12 23:40:55 +00:00
parent b7e026fb3f
commit 8729368f14
6 changed files with 29 additions and 24 deletions

View file

@ -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> Sat Dec 13 01:10:03 2008 TAKAO Kouji <kouji@takao7.net>
* ext/readline/readline.c * ext/readline/readline.c

View file

@ -320,17 +320,16 @@ f_complex_new_bang2(VALUE klass, VALUE x, VALUE y)
return nucomp_s_new_internal(klass, x, y); return nucomp_s_new_internal(klass, x, y);
} }
#ifdef CANONICALIZATION_FOR_MATHN
#define CANON #define CANON
#endif
#ifdef CANON #ifdef CANON
static int canonicalization = 0; static int canonicalization = 0;
void 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; canonicalization = f;
} }
#endif #endif
@ -1428,11 +1427,7 @@ Init_Complex(void)
rb_undef_method(rb_cComplex, "step"); rb_undef_method(rb_cComplex, "step");
rb_undef_method(rb_cComplex, "truncate"); rb_undef_method(rb_cComplex, "truncate");
#ifndef NUBY #if 0 /* NUBY */
#define NUBY 0
#endif
#if NUBY
rb_undef_method(rb_cComplex, "//"); rb_undef_method(rb_cComplex, "//");
#endif #endif

View file

@ -80,6 +80,9 @@ fi
AC_SUBST(MAJOR) AC_SUBST(MAJOR)
AC_SUBST(MINOR) AC_SUBST(MINOR)
AC_SUBST(TEENY) AC_SUBST(TEENY)
if test "$MAJOR" = "1"; then
AC_DEFINE(CANONICALIZATION_FOR_MATHN)
fi
dnl checks for alternative programs dnl checks for alternative programs
AC_ARG_WITH(gcc, [ --without-gcc never use gcc], [ AC_ARG_WITH(gcc, [ --without-gcc never use gcc], [
case $withval in case $withval in

View file

@ -1,7 +1,7 @@
extern void nucomp_canonicalize(int); extern void nucomp_canonicalization(int);
void void
Init_complex(void) Init_complex(void)
{ {
nucomp_canonicalize(1); nucomp_canonicalization(1);
} }

View file

@ -1,7 +1,7 @@
extern void nurat_canonicalize(int); extern void nurat_canonicalization(int);
void void
Init_rational(void) Init_rational(void)
{ {
nurat_canonicalize(1); nurat_canonicalization(1);
} }

View file

@ -377,17 +377,16 @@ f_rational_new_bang2(VALUE klass, VALUE x, VALUE y)
return nurat_s_new_internal(klass, x, y); return nurat_s_new_internal(klass, x, y);
} }
#ifdef CANONICALIZATION_FOR_MATHN
#define CANON #define CANON
#endif
#ifdef CANON #ifdef CANON
static int canonicalization = 0; static int canonicalization = 0;
void 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; canonicalization = f;
} }
#endif #endif
@ -1543,11 +1542,7 @@ Init_Rational(void)
rb_define_method(rb_cRational, "div", nurat_idiv, 1); rb_define_method(rb_cRational, "div", nurat_idiv, 1);
#ifndef NUBY #if 0 /* NUBY */
#define NUBY 0
#endif
#if NUBY
rb_define_method(rb_cRational, "//", nurat_idiv, 1); rb_define_method(rb_cRational, "//", nurat_idiv, 1);
#endif #endif