File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ typedef mrb_int mrb_sec;
217
217
(sizeof(time_t) <= 4 ? INT32_MAX : INT64_MAX) \
218
218
)
219
219
220
- #ifndef MRB_NO_FLOAT
220
+ #if defined( MRB_NO_FLOAT ) || defined( MRB_USE_BIGINT )
221
221
/* return true if time_t is fit in mrb_int */
222
222
static mrb_bool
223
223
fixable_time_t_p (time_t v )
@@ -948,11 +948,18 @@ mrb_time_to_i(mrb_state *mrb, mrb_value self)
948
948
struct mrb_time * tm ;
949
949
950
950
tm = time_get_ptr (mrb , self );
951
- #ifndef MRB_NO_FLOAT
952
951
if (!fixable_time_t_p (tm -> sec )) {
952
+ #if defined(MRB_USE_BIGINT )
953
+ if (MRB_TIME_T_UINT ) {
954
+ return mrb_bint_new_uint64 (mrb , (uint64_t )tm -> sec );
955
+ }
956
+ else {
957
+ return mrb_bint_new_int64 (mrb , (int64_t )tm -> sec );
958
+ }
959
+ #elif !defined(MRB_NO_FLOAT )
953
960
return mrb_float_value (mrb , (mrb_float )tm -> sec );
954
- }
955
961
#endif
962
+ }
956
963
return mrb_int_value (mrb , (mrb_int )tm -> sec );
957
964
}
958
965
You can’t perform that action at this time.
0 commit comments