From 68cf8346cd250c1a47a807f19e1289910f55ecb7 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Mon, 22 Mar 2021 10:59:35 +0900 Subject: Use global defines for `Rational` and `Complex`. --- mrbgems/mruby-complex/mrbgem.rake | 2 +- mrbgems/mruby-rational/mrbgem.rake | 2 +- mrbgems/mruby-rational/src/rational.c | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mrbgems/mruby-complex/mrbgem.rake b/mrbgems/mruby-complex/mrbgem.rake index 6c4b629ca..cd81ecd02 100644 --- a/mrbgems/mruby-complex/mrbgem.rake +++ b/mrbgems/mruby-complex/mrbgem.rake @@ -2,6 +2,6 @@ MRuby::Gem::Specification.new('mruby-complex') do |spec| spec.license = 'MIT' spec.author = 'mruby developers' spec.summary = 'Complex class' - spec.build.cc.defines << "MRB_USE_COMPLEX" + spec.build.defines << "MRB_USE_COMPLEX" spec.add_dependency 'mruby-math', core: 'mruby-math' end diff --git a/mrbgems/mruby-rational/mrbgem.rake b/mrbgems/mruby-rational/mrbgem.rake index 358fb838a..ab5dc5fd1 100644 --- a/mrbgems/mruby-rational/mrbgem.rake +++ b/mrbgems/mruby-rational/mrbgem.rake @@ -2,5 +2,5 @@ MRuby::Gem::Specification.new('mruby-rational') do |spec| spec.license = 'MIT' spec.author = 'mruby developers' spec.summary = 'Rational class' - spec.build.cc.defines << "MRB_USE_RATIONAL" + spec.build.defines << "MRB_USE_RATIONAL" end diff --git a/mrbgems/mruby-rational/src/rational.c b/mrbgems/mruby-rational/src/rational.c index d046864c7..9d819d0f8 100644 --- a/mrbgems/mruby-rational/src/rational.c +++ b/mrbgems/mruby-rational/src/rational.c @@ -379,9 +379,10 @@ mrb_rational_eq(mrb_state *mrb, mrb_value x, mrb_value y) } return a == b; } + #ifdef MRB_USE_COMPLEX case MRB_TT_COMPLEX: - { + { mrb_bool mrb_complex_eq(mrb_state *mrb, mrb_value, mrb_value); return mrb_complex_eq(mrb, y, x); } -- cgit v1.2.3