Use global defines for Rational and Complex.

This commit is contained in:
Yukihiro "Matz" Matsumoto
2021-03-22 10:59:35 +09:00
parent 384865997d
commit 68cf8346cd
3 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+2 -1
View File
@@ -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);
}