[Mingw-w64-public] [PATCH v2 7/7] crt: Move find, stat and time aliases to def-include/msvcrt-common.def.in

2024-05-08 Thread Martin Storsjö
From: Pali Rohár 

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.

This change adds new symbol aliases which were missing.
There is no symbol change or removal.

For reference here is list of changes between individual outputs from:

  cpp -x c $FILE -Wp,-w -undef -P -Imingw-w64-crt/def-include -D$PLAT | sed -E 
's/\s*;.*//' | LC_ALL=C sort -u

Signed-off-by: Martin Storsjö 
---
 .../def-include/msvcrt-common.def.in  | 157 ++
 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  |  24 ---
 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   |  18 --
 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, 172 insertions(+), 381 deletions(-)

diff --git a/mingw-w64-crt/def-include/msvcrt-common.def.in 
b/mingw-w64-crt/def-include/msvcrt-common.def.in
index 3e2c674d3..26aa13e6b 100644
--- a/mingw-w64-crt/def-include/msvcrt-common.def.in
+++ b/mingw-w64-crt/def-include/msvcrt-common.def.in
@@ -119,6 +119,9 @@ ADD_UNDERSCORE(ungetch)
 ADD_UNDERSCORE(unlink)
 #ifndef UCRTBASE
 ADD_UNDERSCORE(utime)
+#else
+F32(utime == _utime32)
+F64(utime == _utime64)
 #endif
 ADD_UNDERSCORE(wcsdup)
 ADD_UNDERSCORE(wcsicmp)
@@ -197,6 +200,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)
+F32(_findfirsti64 == _findfirst32i64)
+F64(_findfirsti64 == _findfirst64)
+F32(_findnext == _findnext32)
+F64(_findnext == _findnext64i32)
+F32(_findnexti64 == _findnext32i64)
+F64(_findnexti64 == _findnext64)
+F32(_wfindfirst == _wfindfirst32)
+F64(_wfindfirst == _wfindfirst64i32)
+F32(_wfindfirsti64 == _wfindfirst32i64)
+F64(_wfindfirsti64 == _wfindfirst64)
+F32(_wfindnext == _wfindnext32)
+F64(_wfindnext == _wfindnext64i32)
+F32(_wfindnexti64 == _wfindnext32i64)
+F64(_wfindnexti64 == _wfindnext64)
+#endif
+
+; This is list of stat symbol aliases, every CRT library has either stat 
symbols with SIZE suffix or without them
+#ifdef FIXED_SIZE_SYMBOLS
+F32(_fstat32 == _fstat)
+F64(_fstat64i32 == _fstat)
+#ifndef NO_I64_FIXED_SIZE
+F32(_fstat32i64 == _fstati64)
+#ifndef NO_FIXED_SIZE_64_ALIAS
+F64(_fstat64 == _fstati64)
+#endif
+#endif
+F32(_stat32 == _stat)
+F64(_stat64i32 == _stat)
+#ifndef NO_I64_FIXED_SIZE
+F32(_stat32i64 == _stati64)
+#ifndef NO_FIXED_SIZE_64_ALIAS
+F64(_stat64 == _stati64)
+#endif
+#endif
+#ifndef NO_WIDE_FIXED_SIZE
+F32(_wstat32 == _wstat)
+F64(_wstat64i32 == _wstat)
+#ifndef NO_I64_FIXED_SIZE
+F32(_wstat32i64 == _wstati64)
+#ifndef NO_FIXED_SIZE_64_ALIAS
+F64(_wstat64 == _wstati64)
+#endif
+#endif
+#endif
+#else
+F32(_fstat == _fstat32)
+F64(_fstat == _fstat64i32)
+F32(_fstati64 == _fstat32i64)
+F64(_fstati64 == _fstat64)
+F32(_stat == _stat32)
+F64(_stat == _

Re: [Mingw-w64-public] [PATCH v2 7/7] crt: Move find, stat and time aliases to def-include/msvcrt-common.def.in

2024-05-08 Thread LIU Hao

在 2024-05-08 17:22, Martin Storsjö 写道:

From: Pali Rohár 

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.

This change adds new symbol aliases which were missing.
There is no symbol change or removal.

For reference here is list of changes between individual outputs from:

   cpp -x c $FILE -Wp,-w -undef -P -Imingw-w64-crt/def-include -D$PLAT | sed -E 
's/\s*;.*//' | LC_ALL=C sort -u

Signed-off-by: Martin Storsjö 
---


This series of patches look good to me. Thanks for the work.


--
Best regards,
LIU Hao



OpenPGP_signature.asc
Description: OpenPGP digital signature
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public