Side note: This patch is not meant to address the issue about default size of `time_t`, due to possibility of ABI break.

--
Best regards,
Liu Hao
From 6ffd67853efba37f7bdd1664e99dd26d3a6da5c1 Mon Sep 17 00:00:00 2001
From: Liu Hao <[email protected]>
Date: Tue, 30 Mar 2021 22:19:33 +0800
Subject: [PATCH] crt: Add symbols for POSIX time functions and find{first,next} 
functions

These may satisfy configure scripts so they don't fail with undefined
references, but such functions are not meant to be called without
declaring `time_t` correctly.

Reference: https://github.com/msys2/CLANG-packages/issues/21
Signed-off-by: Liu Hao <[email protected]>
---
 .../api-ms-win-crt-filesystem-l1-1-0.def      |  4 ++--
 .../lib-common/api-ms-win-crt-time-l1-1-0.def | 16 ++++++++++-----
 mingw-w64-crt/lib-common/ucrtbase.def.in      | 20 ++++++++++++-------
 3 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/mingw-w64-crt/lib-common/api-ms-win-crt-filesystem-l1-1-0.def 
b/mingw-w64-crt/lib-common/api-ms-win-crt-filesystem-l1-1-0.def
index f62ae1fe..89f7a241 100644
--- a/mingw-w64-crt/lib-common/api-ms-win-crt-filesystem-l1-1-0.def
+++ b/mingw-w64-crt/lib-common/api-ms-win-crt-filesystem-l1-1-0.def
@@ -11,12 +11,12 @@ _chdrive
 _chmod
 chmod == _chmod
 _findclose
-_findfirst == _findfirst32
+_findfirst == F32(_findfirst32) F64(_findfirst64)
 _findfirst32
 _findfirst32i64
 _findfirst64
 _findfirst64i32
-_findnext == _findnext32
+_findnext == F32(_findnext32) F64(_findnext64)
 _findnext32
 _findnext32i64
 _findnext64
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 45567547..fbb06032 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 == _ftime32
+_ftime == F32(_ftime32) F64(_ftime64)
 _ftime32
 _ftime32_s
 _ftime64
 _ftime64_s
-_futime == _futime32
+_futime == F32(_futime32) F64(_futime64)
 _futime32
 _futime64
 _get_daylight
@@ -53,8 +53,8 @@ _timespec32_get
 _timespec64_get
 ; This is wrapped in the compat code.
 _tzset DATA
-_utime == _utime32
-utime == _utime32
+_utime == F32(_utime32) F64(_utime64)
+utime == F32(_utime32) F64(_utime64)
 _utime32
 _utime64
 _W_Getdays
@@ -72,7 +72,7 @@ _wstrdate
 _wstrdate_s
 _wstrtime
 _wstrtime_s
-_wutime == _wutime32
+_wutime == F32(_wutime32) F64(_wutime64)
 _wutime32
 _wutime64
 asctime
@@ -80,3 +80,9 @@ asctime_s
 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)
diff --git a/mingw-w64-crt/lib-common/ucrtbase.def.in 
b/mingw-w64-crt/lib-common/ucrtbase.def.in
index eaa7e636..e55fff12 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 == _findfirst32
+_findfirst == F32(_findfirst32) F64(_findfirst64)
 _findfirst32
 _findfirst32i64
 _findfirst64
 _findfirst64i32
-_findnext == _findnext32
+_findnext == F32(_findnext32) F64(_findnext64)
 _findnext32
 _findnext32i64
 _findnext64
@@ -364,14 +364,14 @@ _fstat64i32
 _ftell_nolock
 _ftelli64
 _ftelli64_nolock
-_ftime == _ftime32
+_ftime == F32(_ftime32) F64(_ftime64)
 _ftime32
 _ftime32_s
 _ftime64
 _ftime64_s
 F_I386(_ftol)
 _fullpath
-_futime == _futime32
+_futime == F32(_futime32) F64(_futime64)
 _futime32
 _futime64
 _fwrite_nolock
@@ -2028,7 +2028,7 @@ _unlink
 _unloaddll
 _unlock_file
 _unlock_locales
-_utime == _utime32
+_utime == F32(_utime32) F64(_utime64)
 _utime32
 _utime64
 _waccess
@@ -2173,7 +2173,7 @@ _wtol_l
 _wtoll
 _wtoll_l
 _wunlink
-_wutime == _wutime32
+_wutime == F32(_wutime32) F64(_wutime64)
 _wutime32
 _wutime64
 _y0
@@ -2605,7 +2605,7 @@ truncl F_X86_ANY(DATA)
 unexpected
 ungetc
 ungetwc
-utime == _utime32
+utime == F32(_utime32) F64(_utime64)
 wcrtomb
 wcrtomb_s
 wcscat
@@ -2652,3 +2652,9 @@ wctrans
 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)
-- 
2.31.0

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