Re: [Mingw-w64-public] [PATCH 2/9] crt: Include msvcrt-common.def.in after declaring all library symbols

2024-05-20 Thread Martin Storsjö

On Mon, 20 May 2024, Pali Rohár wrote:


On Monday 20 May 2024 13:04:33 Martin Storsjö wrote:

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


File msvcrt-common.def.in adds just symbol aliases, so include it in CRT
def files after having all symbols declared.

Note that some def files use DECORATED_EXPORT macro from func.def.in file,
so include func.def.in at beginning of each def file.


I guess def files also could use many other of the macros defined in
func.def.in, like F32(), F64() etc - not only DECORATED_EXPORT? (Not sure if
this is done in practice or not though.)

// Martin


That it truth. For example msvcrt.def.in uses also other macros from
func.def.in file.

So what about rephrasing commit message to something like this?

 Note that some def files use macros from func.def.in file,
 so include func.def.in at beginning of the file when needed.


This sounds good to me, thanks!

// Martin

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


Re: [Mingw-w64-public] [PATCH 2/9] crt: Include msvcrt-common.def.in after declaring all library symbols

2024-05-20 Thread Pali Rohár
On Monday 20 May 2024 13:04:33 Martin Storsjö wrote:
> On Thu, 9 May 2024, Pali Rohár wrote:
> 
> > File msvcrt-common.def.in adds just symbol aliases, so include it in CRT
> > def files after having all symbols declared.
> > 
> > Note that some def files use DECORATED_EXPORT macro from func.def.in file,
> > so include func.def.in at beginning of each def file.
> 
> I guess def files also could use many other of the macros defined in
> func.def.in, like F32(), F64() etc - not only DECORATED_EXPORT? (Not sure if
> this is done in practice or not though.)
> 
> // Martin

That it truth. For example msvcrt.def.in uses also other macros from
func.def.in file.

So what about rephrasing commit message to something like this?

  Note that some def files use macros from func.def.in file,
  so include func.def.in at beginning of the file when needed.


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


Re: [Mingw-w64-public] [PATCH 2/9] crt: Include msvcrt-common.def.in after declaring all library symbols

2024-05-20 Thread Martin Storsjö

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


File msvcrt-common.def.in adds just symbol aliases, so include it in CRT
def files after having all symbols declared.

Note that some def files use DECORATED_EXPORT macro from func.def.in file,
so include func.def.in at beginning of each def file.


I guess def files also could use many other of the macros defined in 
func.def.in, like F32(), F64() etc - not only DECORATED_EXPORT? (Not sure 
if this is done in practice or not though.)


// Martin

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


[Mingw-w64-public] [PATCH 2/9] crt: Include msvcrt-common.def.in after declaring all library symbols

2024-05-08 Thread Pali Rohár
File msvcrt-common.def.in adds just symbol aliases, so include it in CRT
def files after having all symbols declared.

Note that some def files use DECORATED_EXPORT macro from func.def.in file,
so include func.def.in at beginning of each def file.
---
 mingw-w64-crt/lib-common/msvcr120_app.def.in | 13 
 mingw-w64-crt/lib-common/msvcrt.def.in   | 32 +++-
 mingw-w64-crt/lib-common/ucrtbase.def.in |  6 ++--
 mingw-w64-crt/lib32/crtdll.def.in| 15 -
 mingw-w64-crt/lib32/msvcr100.def.in  | 18 +--
 mingw-w64-crt/lib32/msvcr110.def.in  | 17 +--
 mingw-w64-crt/lib32/msvcr120.def.in  |  5 ++-
 mingw-w64-crt/lib32/msvcr120d.def.in |  4 +--
 mingw-w64-crt/lib32/msvcr70.def.in   | 15 +
 mingw-w64-crt/lib32/msvcr71.def.in   | 15 +
 mingw-w64-crt/lib32/msvcr80.def.in   | 15 +
 mingw-w64-crt/lib32/msvcr90.def.in   | 16 +-
 mingw-w64-crt/lib32/msvcr90d.def.in  | 16 +-
 mingw-w64-crt/lib32/msvcrt10.def.in  | 15 +
 mingw-w64-crt/lib32/msvcrt20.def.in  | 15 -
 mingw-w64-crt/lib32/msvcrt40.def.in  | 12 
 mingw-w64-crt/lib64/msvcr100.def.in  | 17 +--
 mingw-w64-crt/lib64/msvcr110.def.in  | 17 +--
 mingw-w64-crt/lib64/msvcr120.def.in  |  5 ++-
 mingw-w64-crt/lib64/msvcr120d.def.in |  4 +--
 mingw-w64-crt/lib64/msvcr80.def.in   | 15 -
 mingw-w64-crt/lib64/msvcr90.def.in   | 15 +
 mingw-w64-crt/lib64/msvcr90d.def.in  | 15 +
 23 files changed, 157 insertions(+), 160 deletions(-)

diff --git a/mingw-w64-crt/lib-common/msvcr120_app.def.in 
b/mingw-w64-crt/lib-common/msvcr120_app.def.in
index 695635caf16f..6f3376a58fc2 100644
--- a/mingw-w64-crt/lib-common/msvcr120_app.def.in
+++ b/mingw-w64-crt/lib-common/msvcr120_app.def.in
@@ -7,12 +7,6 @@ LIBRARY "msvcr120_app.dll"
 EXPORTS
 
 #include "func.def.in"
-#define NO_GETPID_ALIAS
-#ifdef DEF_ARM32
-#define NO_STRCMPI_ALIAS
-#define FIXED_SIZE_SYMBOLS
-#endif
-#include "msvcrt-common.def.in"
 
 #ifdef DEF_X64
 $I10_OUTPUT
@@ -2502,3 +2496,10 @@ wprintf
 wprintf_s
 wscanf
 wscanf_s
+
+#define NO_GETPID_ALIAS
+#ifdef DEF_ARM32
+#define NO_STRCMPI_ALIAS
+#define FIXED_SIZE_SYMBOLS
+#endif
+#include "msvcrt-common.def.in"
diff --git a/mingw-w64-crt/lib-common/msvcrt.def.in 
b/mingw-w64-crt/lib-common/msvcrt.def.in
index 6ce7a0366702..186761c9d09b 100644
--- a/mingw-w64-crt/lib-common/msvcrt.def.in
+++ b/mingw-w64-crt/lib-common/msvcrt.def.in
@@ -1,22 +1,7 @@
 LIBRARY "msvcrt.dll"
 EXPORTS
 
-#define PRE_C95_SWPRINTF
-#define FIXED_SIZE_SYMBOLS
-#define NO_FIXED_SIZE_64_ALIAS
-#define NO_TIME_ALIAS
-#define NO_STRCMPI_ALIAS
-#define WITH_ATOLL_ALIAS
-#define WITH_ATOLL_L_ALIAS
-#define WITH_STRTO64_L_ALIAS
-#ifndef DEF_I386
-; i386 llabs and imaxabs alias provided by emu
-#define WITH_LLABS_ALIAS
-; i386 strtoll, strtoull, strtoimax and strtoumax alias provided by emu
-#define WITH_STRTO64_ALIAS
-#endif
 #include "func.def.in"
-#include "msvcrt-common.def.in"
 
 ; List of I386 C++ mangled symbols which matches the first I386 version of 
msvcrt.dll (Microsoft Visual C++ 4.2)
 #ifdef DEF_I386
@@ -1835,6 +1820,23 @@ F_ARM_ANY(fabsf) ; i386 and x64 fabsf provided by emu
 

 
 
+; This includes list of some symbol alises for compatibility with C99 and 
POSIX functions and symbols from other msvcr* libraries
+#define PRE_C95_SWPRINTF
+#define FIXED_SIZE_SYMBOLS
+#define NO_FIXED_SIZE_64_ALIAS
+#define NO_TIME_ALIAS
+#define NO_STRCMPI_ALIAS
+#define WITH_ATOLL_ALIAS
+#define WITH_ATOLL_L_ALIAS
+#define WITH_STRTO64_L_ALIAS
+#ifndef DEF_I386
+; i386 llabs and imaxabs alias provided by emu
+#define WITH_LLABS_ALIAS
+; i386 strtoll, strtoull, strtoimax and strtoumax alias provided by emu
+#define WITH_STRTO64_ALIAS
+#endif
+#include "msvcrt-common.def.in"
+
 ; This is list of additional symbol aliases not available in any CRT library
 ; FIXME: check if these really are needed
 F32(_ftime_s == _ftime32_s)
diff --git a/mingw-w64-crt/lib-common/ucrtbase.def.in 
b/mingw-w64-crt/lib-common/ucrtbase.def.in
index 16127eb8169a..f42cf8f680bc 100644
--- a/mingw-w64-crt/lib-common/ucrtbase.def.in
+++ b/mingw-w64-crt/lib-common/ucrtbase.def.in
@@ -2,8 +2,6 @@ LIBRARY "ucrtbase.dll"
 EXPORTS
 
 #include "func.def.in"
-#define UCRTBASE
-#include "msvcrt-common.def.in"
 
 #ifdef DEF_I386
 _CIacos
@@ -2645,6 +2643,10 @@ wctrans
 wctype
 wmemcpy_s
 wmemmove_s
+
+#define UCRTBASE
+#include "msvcrt-common.def.in"
+
 ; These functions may satisfy configure scripts.
 F32(timespec_get == _timespec32_get)
 F64(timespec_get == _timespec64_get)
diff --git a/mingw-w64-crt/lib32/crtdll.def.in 
b/mingw-w64-crt/lib32/crtdll.def.in
index e12edb5ad7f3..47c5f4558085 100644
--- a/mingw-w64-crt/lib32/crtdll.def.in
+++