API for __getmainargs() function in msvcrt10.dll is same as __GetMainArgs()
function in crtdll.dll. It is slightly different than in any other msvcrt
versions. It returns void and does not the pointer to the _startupinfo
structure as a last argument.

So for compatibility with mingw-w64 startup code, in msvcrt10 import
library rename the real __getmainargs symbol to __GetMainArgs and use
mingw-w64 crtdll.dll's wrapper __getmainargs around the __GetMainArgs for
providing the compatible __getmainargs() function.
---
 mingw-w64-crt/Makefile.am           | 1 +
 mingw-w64-crt/lib32/msvcrt10.def.in | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index 7ae935690549..788957dc81c1 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -598,6 +598,7 @@ src_crtdll=\
   stdio/mingw_lock.c
 
 src_msvcrt10=\
+  crt/crtdll_getmainargs.c \
   misc/___mb_cur_max_func.c \
   misc/__initenv.c \
   misc/__p___argv.c \
diff --git a/mingw-w64-crt/lib32/msvcrt10.def.in 
b/mingw-w64-crt/lib32/msvcrt10.def.in
index ac918799d7a3..fc7468e1efe4 100644
--- a/mingw-w64-crt/lib32/msvcrt10.def.in
+++ b/mingw-w64-crt/lib32/msvcrt10.def.in
@@ -888,7 +888,7 @@ __argv DATA
 __dllonexit
 __doserrno
 __fpecode
-__getmainargs
+__GetMainArgs == __getmainargs ; msvcrt10.dll's __getmainargs has same API as 
crtdll.dll's __GetMainArgs, real __getmainargs provided by emu
 __isascii
 __iscsym
 __iscsymf
-- 
2.20.1



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

Reply via email to