Commit 65678f11 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #2058 from cremno/mruby-time-more-portable

mruby-time: two small changes for portability
parents 382aed8a 06a946ab
......@@ -86,7 +86,7 @@ gettimeofday(struct timeval *tv, void *tz)
#endif
#ifdef NO_GMTIME_R
#define gmtime_r(t,r) gmtime(t)
#define localtime_r(t,r) (tzset(),localtime(t))
#define localtime_r(t,r) localtime(t)
#endif
#ifndef USE_SYSTEM_TIMEGM
......@@ -293,7 +293,7 @@ time_mktime(mrb_state *mrb, mrb_int ayear, mrb_int amonth, mrb_int aday,
else {
nowsecs = mktime(&nowtime);
}
if (nowsecs < 0) {
if (nowsecs == (time_t)-1) {
mrb_raise(mrb, E_ARGUMENT_ERROR, "Not a valid time.");
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment