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:
parent
b7e026fb3f
commit
8729368f14
6 changed files with 29 additions and 24 deletions
12
ChangeLog
12
ChangeLog
|
@ -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
|
||||
|
|
15
complex.c
15
complex.c
|
@ -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
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
15
rational.c
15
rational.c
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue