Actions
Bug #6794
closedx64 mingw: test_at(TestTime) failure
Description
x64 mingw has the following failure.
[ 5/65] TestTime#test_at = 0.00 s
- Failure:
test_at(TestTime) [c:/Users/hiroshi/work/ruby/test/ruby/test_time.rb:194]:
<-146138510344> expected but was
<1970>.
I guess Time.at(large value) fails for the following reason.
Time.at calls FileTimeToSystemTime() in localtime_r().
https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L6565
Time limit is 0x8000000000000000 which is a little smaller than 8bytes(= time_t)(= long long).
http://msdn.microsoft.com/en-us/library/windows/desktop/ms724280(v=vs.85).aspx
Instead, using _localtime_64s() seems to work fine.
I changed to use _gmtime_64s() for consistency. I added declarations since mingw-w64 doesn't have these declaration.
I attached a patch.
Files
Actions
Like0
Like0Like0Like0Like0Like0