Thanks to visit codestin.com
Credit goes to github.com

Skip to content

FIX: Use the NPY_TIME_T macro everywhere #2856

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 27, 2012
Merged

Conversation

certik
Copy link
Contributor

@certik certik commented Dec 27, 2012

Previously, two (critical) parts of the code used time_t instead of
NPY_TIME_T. Due to the fact, that most of the time NPY_TIME_T was equal to
time_t, this bug didn't show up. But in mingw, NPY_TIME_T is actually equal
to __time64_t and then this causes 64 bit integers to be cast into 32 bit
integers (thus becoming negative), which causes localtime() to fail in mingw.

Fixes gh-568.

Previously, two (critical) parts of the code used `time_t` instead of
`NPY_TIME_T`. Due to the fact, that most of the time `NPY_TIME_T` was equal to
`time_t`, this bug didn't show up. But in mingw, `NPY_TIME_T` is actually equal
to `__time64_t` and then this causes 64 bit integers to be cast into 32 bit
integers (thus becoming negative), which causes localtime() to fail in mingw.

Fixes numpygh-568.
@charris
Copy link
Member

charris commented Dec 27, 2012

Looks good to me. I'll leave the ticket open until datetime gets wider testing.

charris added a commit that referenced this pull request Dec 27, 2012
FIX: Use the NPY_TIME_T macro everywhere
@charris charris merged commit 7a0c495 into numpy:master Dec 27, 2012
@certik certik deleted the fix568 branch December 27, 2012 15:11
@certik
Copy link
Contributor Author

certik commented Dec 27, 2012

Thanks. Backported in #2857.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Datetime failures with MinGW (Trac #2108)
2 participants