diff options
| author | dearblue <[email protected]> | 2019-07-27 18:49:22 +0900 |
|---|---|---|
| committer | dearblue <[email protected]> | 2019-07-27 21:25:18 +0900 |
| commit | fda5c0c073a0b7a2bbcfb37ddf735a2f04f9ea08 (patch) | |
| tree | 58954d25c8989e14c8783ac40edd29e776a0ddb6 /mrbgems/mruby-time/include | |
| parent | 2f0a95768b8753448eb819e1bd3d250b69844828 (diff) | |
| download | mruby-fda5c0c073a0b7a2bbcfb37ddf735a2f04f9ea08.tar.gz mruby-fda5c0c073a0b7a2bbcfb37ddf735a2f04f9ea08.zip | |
Fix the lack of precision for `Time`; ref d74355061
- `Time.local` and `Time.utc` are able to use with `MRB_INT16 + MRB_WITHOUT_FLOAT`.
- `time_t` is converted directly from the Ruby object.
- `time + sec` and` time - sec` are not affected by the precision of `mrb_float`.
Similarly, calculations are possible with `MRB_INT16 + MRB_WITHOUT_FLOAT`.
Diffstat (limited to 'mrbgems/mruby-time/include')
| -rw-r--r-- | mrbgems/mruby-time/include/mruby/time.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mrbgems/mruby-time/include/mruby/time.h b/mrbgems/mruby-time/include/mruby/time.h index 9b1cdfacd..1adcfd49c 100644 --- a/mrbgems/mruby-time/include/mruby/time.h +++ b/mrbgems/mruby-time/include/mruby/time.h @@ -8,6 +8,7 @@ #define MRUBY_TIME_H #include "mruby/common.h" +#include <time.h> MRB_BEGIN_DECL @@ -18,7 +19,7 @@ typedef enum mrb_timezone { MRB_TIMEZONE_LAST = 3 } mrb_timezone; -MRB_API mrb_value mrb_time_at(mrb_state *mrb, mrb_int sec, mrb_int usec, mrb_timezone timezone); +MRB_API mrb_value mrb_time_at(mrb_state *mrb, time_t sec, time_t usec, mrb_timezone timezone); MRB_END_DECL |
