From 17cb50f8d0d3bd24ad53e6543f2534ecc9f5a602 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Sat, 2 Jan 2021 23:49:41 +0900 Subject: Avoid `int64_t` on 32 bit platforms. --- mrbgems/mruby-rational/src/rational.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mrbgems/mruby-rational/src/rational.c b/mrbgems/mruby-rational/src/rational.c index a151e0453..deb48ef8a 100644 --- a/mrbgems/mruby-rational/src/rational.c +++ b/mrbgems/mruby-rational/src/rational.c @@ -102,8 +102,10 @@ rational_new(mrb_state *mrb, mrb_int numerator, mrb_int denominator) */ #ifdef MRB_INT32 typedef float rat_float; +typedef int32_t rat_int; #else typedef double rat_float; +typedef int64_t rat_int; #endif void mrb_check_num_exact(mrb_state *mrb, mrb_float num); @@ -116,7 +118,7 @@ rational_new_f(mrb_state *mrb, mrb_float f0) /* a: continued fraction coefficients. */ mrb_int a, h[3] = { 0, 1, 0 }, k[3] = { 1, 0, 0 }; mrb_int x, d; - int64_t n = 1; + rat_int n = 1; int i, neg = 0; mrb_check_num_exact(mrb, f0); -- cgit v1.2.3