Project

General

Profile

Bug #6794 ยป 0001-Fix-localtime_r-with-large-value-on-x64-mingw.patch

h.shirosaki (Hiroshi Shirosaki), 07/26/2012 07:48 AM

View differences:

win32/win32.c
return _osfile(fd) & FTEXT;
}
#if RUBY_MSVCRT_VERSION < 80
#if RUBY_MSVCRT_VERSION < 80 && !defined(__MINGW64__)
/* License: Ruby's */
static int
unixtime_to_systemtime(const time_t t, SYSTEMTIME *st)
......
}
#endif
#ifdef __MINGW64__
#ifndef gmtime_s
# define gmtime_s _gmtime64_s
errno_t gmtime_s(struct tm* _tm, const time_t *time);
#endif
#ifndef localtime_s
# define localtime_s _localtime64_s
errno_t localtime_s(struct tm* _tm, const time_t *time);
#endif
#endif
/* License: Ruby's */
struct tm *
gmtime_r(const time_t *tp, struct tm *rp)
......
errno = e;
return NULL;
}
#if RUBY_MSVCRT_VERSION >= 80
#if RUBY_MSVCRT_VERSION >= 80 || defined(__MINGW64__)
e = gmtime_s(rp, tp);
if (e != 0) goto error;
#else
......
errno = e;
return NULL;
}
#if RUBY_MSVCRT_VERSION >= 80
#if RUBY_MSVCRT_VERSION >= 80 || defined(__MINGW64__)
e = localtime_s(rp, tp);
if (e) goto error;
#else
    (1-1/1)