On Mon, 22 Apr 2024, Pali Rohár wrote:

Add 4 new macros FIXED_SIZE_SYMBOLS, NO_I64_FIXED_SIZE,
NO_FIXED_SIZE_64_ALIAS and NO_TIME_ALIAS to distinguish
between different crt versions.
---
.../def-include/msvcrt-common.def.in          | 154 ++++++++++++++++++
mingw-w64-crt/lib-common/msvcr120_app.def.in  |  33 +---
mingw-w64-crt/lib-common/msvcrt.def.in        |  23 +--
mingw-w64-crt/lib-common/ucrtbase.def.in      |  12 --
mingw-w64-crt/lib32/crtdll.def.in             |  12 +-
mingw-w64-crt/lib32/msvcr100.def.in           |  18 --
mingw-w64-crt/lib32/msvcr110.def.in           |  18 --
mingw-w64-crt/lib32/msvcr120.def.in           |  14 --
mingw-w64-crt/lib32/msvcr120d.def.in          |  14 --
mingw-w64-crt/lib32/msvcr70.def.in            |  12 +-
mingw-w64-crt/lib32/msvcr71.def.in            |  12 +-
mingw-w64-crt/lib32/msvcr80.def.in            |  22 ---
mingw-w64-crt/lib32/msvcr90.def.in            |  18 --
mingw-w64-crt/lib32/msvcr90d.def.in           |  17 --
mingw-w64-crt/lib32/msvcrt10.def.in           |  12 +-
mingw-w64-crt/lib32/msvcrt20.def.in           |  13 +-
mingw-w64-crt/lib32/msvcrt40.def.in           |  12 +-
mingw-w64-crt/lib64/msvcr100.def.in           |  18 --
mingw-w64-crt/lib64/msvcr110.def.in           |  18 --
mingw-w64-crt/lib64/msvcr120.def.in           |  14 --
mingw-w64-crt/lib64/msvcr120d.def.in          |  13 --
mingw-w64-crt/lib64/msvcr80.def.in            |  22 ---
mingw-w64-crt/lib64/msvcr90.def.in            |  18 --
mingw-w64-crt/lib64/msvcr90d.def.in           |  18 --
24 files changed, 169 insertions(+), 368 deletions(-)

diff --git a/mingw-w64-crt/def-include/msvcrt-common.def.in 
b/mingw-w64-crt/def-include/msvcrt-common.def.in
index 3e2c674d3699..abca29686531 100644
--- a/mingw-w64-crt/def-include/msvcrt-common.def.in
+++ b/mingw-w64-crt/def-include/msvcrt-common.def.in
@@ -197,6 +197,160 @@ _strtoimax_l == _strtoi64_l
_strtoumax_l == _strtoui64_l
#endif

+; This is list of find symbol aliases, every CRT library has either find 
symbols with SIZE suffix or without them
+#ifdef FIXED_SIZE_SYMBOLS
+F32(_findfirst32 == _findfirst)
+F64(_findfirst64i32 == _findfirst)
+#ifndef NO_I64_FIXED_SIZE
+F32(_findfirst32i64 == _findfirsti64)
+#ifndef NO_FIXED_SIZE_64_ALIAS
+F64(_findfirst64 == _findfirsti64)
+#endif
+#endif
+F32(_findnext32 == _findnext)
+F64(_findnext64i32 == _findnext)
+#ifndef NO_I64_FIXED_SIZE
+F32(_findnext32i64 == _findnexti64)
+#ifndef NO_FIXED_SIZE_64_ALIAS
+F64(_findnext64 == _findnexti64)
+#endif
+#endif
+#ifndef NO_WIDE_FIXED_SIZE
+F32(_wfindfirst32 == _wfindfirst)
+F64(_wfindfirst64i32 == _wfindfirst)
+#ifndef NO_I64_FIXED_SIZE
+F32(_wfindfirst32i64 == _wfindfirsti64)
+#ifndef NO_FIXED_SIZE_64_ALIAS
+F64(_wfindfirst64 == _wfindfirsti64)
+#endif
+#endif
+F32(_wfindnext32 == _wfindnext)
+F64(_wfindnext64i32 == _wfindnext)
+#ifndef NO_I64_FIXED_SIZE
+F32(_wfindnext32i64 == _wfindnexti64)
+#ifndef NO_FIXED_SIZE_64_ALIAS
+F64(_wfindnext64 == _wfindnexti64)
+#endif
+#endif
+#endif
+#else
+F32(_findfirst == _findfirst32)
+F64(_findfirst == _findfirst64i32)

This is the case that gets used by ucrtbase.def.in, right?

diff --git a/mingw-w64-crt/lib-common/ucrtbase.def.in 
b/mingw-w64-crt/lib-common/ucrtbase.def.in
index 2d0552f277ef..c8fb1e33b1d7 100644
--- a/mingw-w64-crt/lib-common/ucrtbase.def.in
+++ b/mingw-w64-crt/lib-common/ucrtbase.def.in
@@ -327,12 +327,10 @@ _filelength
_filelengthi64
_fileno
_findclose
-_findfirst == _findfirst64

Note how we unconditionally had these macros pointing at _findfirst64 in ucrt, regardless of architecture.

Now I'm not positively sure that this is all strictly correct, but if it's wrong, I would prefer to fix it in a separate commit, not in a refactoring commit like this one. (Overall, on UCRT we default to 64 bit time_t even on 32 bit architectures.)

However, if we do change the aliases in ucrtbase.def.in, we also need to update api-ms-win-crt-*.def.in as well, as we have similar declarations there, scattered over a dozen of smaller files.

// Martin

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to