On Thu, 9 May 2024, Pali Rohár wrote:

crtdll.dll library has some DATA symbols with _dll suffix.
Fix generating aliases for these symbols.
---
.../def-include/msvcrt-common.def.in          | 23 +++++++++++++++++++
mingw-w64-crt/lib32/crtdll.def.in             |  1 +
2 files changed, 24 insertions(+)

diff --git a/mingw-w64-crt/def-include/msvcrt-common.def.in 
b/mingw-w64-crt/def-include/msvcrt-common.def.in
index 125982d5bf53..98ab6d6b62f8 100644
--- a/mingw-w64-crt/def-include/msvcrt-common.def.in
+++ b/mingw-w64-crt/def-include/msvcrt-common.def.in
@@ -2,6 +2,7 @@

#define ADD_UNDERSCORE(symbol) symbol == _ ## symbol
#define ADD_UNDERSCORE_DATA(symbol) symbol DATA == _ ## symbol
+#define ADD_UNDERSCORE_DATA_DLL(symbol) symbol DATA == _ ## symbol ## _dll
#define ADD_DOUBLE_UNDERSCORE(symbol) symbol == __ ## symbol

; This is list of symbol aliases from the Visual C++ 1.0 oldnames.lib library
@@ -22,14 +23,22 @@ ADD_UNDERSCORE(creat)
; ADD_UNDERSCORE(cscanf)
ADD_UNDERSCORE(cwait)
#ifndef UCRTBASE
+#ifdef CRTDLL
+ADD_UNDERSCORE_DATA_DLL(daylight)
+#else
ADD_UNDERSCORE_DATA(daylight)
#endif
+#endif

Instead of nesting these ifdefs, I think this would be clearer like this:

#ifdef CRTDLL
...
#elif !defined(UCRTBASE)
...
#endif

This seems to be the case for a couple of the other changes as well, but the last ifdef, around sys_errlist and sys_nerr, probably is best to keep as is here.

// 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