mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #2058 from cremno/mruby-time-more-portable
mruby-time: two small changes for portability
This commit is contained in:
@@ -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.");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user