在 2021-03-31 21:45, Liu Hao 写道:
Side note: This patch is not meant to address the issue about default size of `time_t`, due to possibility of ABI break.


And here is the second patch that makes `time_t` unconditionally 64-bit for 
UCRT.


--
Best regards,
Liu Hao
From 00e93ac9d535f4f7e285e706b436e7e7bc1b1b64 Mon Sep 17 00:00:00 2001
From: Liu Hao <[email protected]>
Date: Mon, 5 Apr 2021 18:18:54 +0800
Subject: [PATCH] include/_mingw.h.in,crt: Extend `time_t` to 64 bits for UCRT
 for 32-bit targets

Signed-off-by: Liu Hao <[email protected]>
---
 .../lib-common/api-ms-win-crt-time-l1-1-0.def | 20 ++++++++--------
 mingw-w64-crt/lib-common/ucrtbase.def.in      | 24 +++++++++----------
 mingw-w64-headers/crt/_mingw.h.in             |  2 +-
 3 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/mingw-w64-crt/lib-common/api-ms-win-crt-time-l1-1-0.def 
b/mingw-w64-crt/lib-common/api-ms-win-crt-time-l1-1-0.def
index fbb06032..fcb62ae4 100644
--- a/mingw-w64-crt/lib-common/api-ms-win-crt-time-l1-1-0.def
+++ b/mingw-w64-crt/lib-common/api-ms-win-crt-time-l1-1-0.def
@@ -12,12 +12,12 @@ _ctime64
 _ctime64_s
 _difftime32
 _difftime64
-_ftime == F32(_ftime32) F64(_ftime64)
+_ftime == _ftime64
 _ftime32
 _ftime32_s
 _ftime64
 _ftime64_s
-_futime == F32(_futime32) F64(_futime64)
+_futime == _futime64
 _futime32
 _futime64
 _get_daylight
@@ -53,8 +53,8 @@ _timespec32_get
 _timespec64_get
 ; This is wrapped in the compat code.
 _tzset DATA
-_utime == F32(_utime32) F64(_utime64)
-utime == F32(_utime32) F64(_utime64)
+_utime == _utime64
+utime == _utime64
 _utime32
 _utime64
 _W_Getdays
@@ -72,7 +72,7 @@ _wstrdate
 _wstrdate_s
 _wstrtime
 _wstrtime_s
-_wutime == F32(_wutime32) F64(_wutime64)
+_wutime == _wutime64
 _wutime32
 _wutime64
 asctime
@@ -81,8 +81,8 @@ clock
 strftime
 wcsftime
 ; These functions may satisfy configure scripts.
-ctime == F32(_ctime32) F64(_ctime64)
-gmtime == F32(_gmtime32) F64(_gmtime64)
-localtime == F32(_localtime32) F64(_localtime64)
-mktime == F32(_mktime32) F64(_mktime64)
-time == F32(_time32) F64(_time64)
+ctime == _ctime64
+gmtime == _gmtime64
+localtime == _localtime64
+mktime == _mktime64
+time == _time64
diff --git a/mingw-w64-crt/lib-common/ucrtbase.def.in 
b/mingw-w64-crt/lib-common/ucrtbase.def.in
index e55fff12..a2254bcb 100644
--- a/mingw-w64-crt/lib-common/ucrtbase.def.in
+++ b/mingw-w64-crt/lib-common/ucrtbase.def.in
@@ -327,12 +327,12 @@ _filelength
 _filelengthi64
 _fileno
 _findclose
-_findfirst == F32(_findfirst32) F64(_findfirst64)
+_findfirst == _findfirst64
 _findfirst32
 _findfirst32i64
 _findfirst64
 _findfirst64i32
-_findnext == F32(_findnext32) F64(_findnext64)
+_findnext == _findnext64
 _findnext32
 _findnext32i64
 _findnext64
@@ -364,14 +364,14 @@ _fstat64i32
 _ftell_nolock
 _ftelli64
 _ftelli64_nolock
-_ftime == F32(_ftime32) F64(_ftime64)
+_ftime == _ftime64
 _ftime32
 _ftime32_s
 _ftime64
 _ftime64_s
 F_I386(_ftol)
 _fullpath
-_futime == F32(_futime32) F64(_futime64)
+_futime == _futime64
 _futime32
 _futime64
 _fwrite_nolock
@@ -2028,7 +2028,7 @@ _unlink
 _unloaddll
 _unlock_file
 _unlock_locales
-_utime == F32(_utime32) F64(_utime64)
+_utime == _utime64
 _utime32
 _utime64
 _waccess
@@ -2173,7 +2173,7 @@ _wtol_l
 _wtoll
 _wtoll_l
 _wunlink
-_wutime == F32(_wutime32) F64(_wutime64)
+_wutime == _wutime64
 _wutime32
 _wutime64
 _y0
@@ -2605,7 +2605,7 @@ truncl F_X86_ANY(DATA)
 unexpected
 ungetc
 ungetwc
-utime == F32(_utime32) F64(_utime64)
+utime == _utime64
 wcrtomb
 wcrtomb_s
 wcscat
@@ -2653,8 +2653,8 @@ wctype
 wmemcpy_s
 wmemmove_s
 ; These functions may satisfy configure scripts.
-ctime == F32(_ctime32) F64(_ctime64)
-gmtime == F32(_gmtime32) F64(_gmtime64)
-localtime == F32(_localtime32) F64(_localtime64)
-mktime == F32(_mktime32) F64(_mktime64)
-time == F32(_time32) F64(_time64)
+ctime == _ctime64
+gmtime == _gmtime64
+localtime == _localtime64
+mktime == _mktime64
+time == _time64
diff --git a/mingw-w64-headers/crt/_mingw.h.in 
b/mingw-w64-headers/crt/_mingw.h.in
index 25513d7d..9ce9ca23 100644
--- a/mingw-w64-headers/crt/_mingw.h.in
+++ b/mingw-w64-headers/crt/_mingw.h.in
@@ -367,7 +367,7 @@ typedef int __int128 __attribute__ ((__mode__ (TI)));
 
 #ifndef __WIDL__
 
-#if defined (_WIN32) && !defined (_WIN64) && !defined 
(__MINGW_USE_VC2005_COMPAT)
+#if defined (_WIN32) && !defined (_WIN64) && !defined 
(__MINGW_USE_VC2005_COMPAT) && !defined (_UCRT)
 #ifndef _USE_32BIT_TIME_T
 #define _USE_32BIT_TIME_T
 #endif
-- 
2.31.1

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to