time: use 64-bit time_t in supported mingw environments - #6636
Conversation
8f202dc to
6eb71b0
Compare
6eb71b0 to
278a3eb
Compare
That's too hacky, why can't we do it through preprocessor directives? #ifdef __MINGW32__
/* mingw or mingw-w64 */
#include <_mingw.h>
#ifdef __MINGW64_VERSION_MAJOR
/* mingw-w64 */
/* check for _USE_32BIT_TIME_T */
#else
/* mingw */
#endif
#else
/* other */
/* check for _USE_32BIT_TIME_T */
#endifedit: original mingw time.h some versions at least also use _USE_32BIT_TIME_T but slightly different... #ifndef _TIME_T_DEFINED
/* FIXME __STRICT_ANSI__ ! */
#if __MSVCRT_VERSION__ >= 0x0800
#ifndef _USE_32BIT_TIME_T
typedef __time64_t time_t;
#else
typedef __time32_t time_t;
#endif /* !_USE_32BIT_TIME_T */
#else
typedef __time32_t time_t;
#endif /* __MSVCRT_VERSION__ >= 0x0800 */
#define _TIME_T_DEFINED
#endif |
|
@jay: Agreed, it'd be nice to have this automated, but kept it minimal to stay on the safe side. (and even got that wrong, because So, the mingw-w64 part I do understand, but not so much the classic mingw. Do you have a complete patch-suggestion that includes both? Or, I may tackle mingw-w64 in this patch and we can add classic mingw in a different PR. |
|
I've added the mingw-w64 part. |
c28edbc to
032e317
Compare
|
Failure is on Azure / mingw, [these disappeared too.] and lots of lines like this (these remained): Pushing a cleaned up / squashed version and see how it goes. |
721d7dd to
4aaefc9
Compare
|
One CI session still has those strange Perl error messages. Otherwise I consider this patch ready, with the note that mingw-classic support can be added in a subsequent commit. I personally have long stopped following mingw-classic and no ways to make tests with it. (Official binaries rely on mingw-w64.) |
f05d942 to
4e2e525
Compare
|
I've pushed recommended changes to address original mingw |
3649ae9 to
d95f342
Compare
|
@jay: Thank you very much, LGTM and just squashed. |
c2f4889 to
d7424f6
Compare
d7424f6 to
3e03f48
Compare
Enable 64-bit `time_t` in supported mingw-w64 and mingw environments. (Unless 32-bit `time_t` is selected manually via the `_USE_32BIT_TIME_T` mingw macro.) Previously, 64-bit `time_t` was enabled on VS2005 and newer only, and 32-bit `time_t` was used on all other Windows builds. Assisted-by: Jay Satiro Closes #xxxx
3e03f48 to
bd30f33
Compare
Enable 64-bit
time_tin supported mingw-w64 and mingw environments. (Unless 32-bittime_tis selected manually via the_USE_32BIT_TIME_Tmingw macro.)Previously, 64-bit
time_twas enabled on VS2005 and newer only, and 32-bittime_twas used on all other Windows builds.