mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[CRT] ARM & ARM64 Windows do not have initenv in their CRTs (#1597)
Native CRT on ARM & ARM64 Windows doesn't have these functions. For compatibility, it's mandatory to not have it at all. Otherwise, ARM executables built for ReactOS do not run on true ARM Windows. Consider doing full sync with mingw-w64 CRT in future.
This commit is contained in:
parent
666bac44c0
commit
f2f97f9f4c
1 changed files with 10 additions and 0 deletions
|
@ -24,6 +24,10 @@
|
|||
#include <mbstring.h>
|
||||
#endif
|
||||
|
||||
/* Special handling for ARM & ARM64, __winitenv & __initenv aren't present there. */
|
||||
|
||||
#if !defined(__arm__) && !defined(__aarch64__)
|
||||
|
||||
#ifndef __winitenv
|
||||
extern wchar_t *** __MINGW_IMP_SYMBOL(__winitenv);
|
||||
#define __winitenv (* __MINGW_IMP_SYMBOL(__winitenv))
|
||||
|
@ -34,6 +38,8 @@ extern char *** __MINGW_IMP_SYMBOL(__initenv);
|
|||
#define __initenv (* __MINGW_IMP_SYMBOL(__initenv))
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* Hack, for bug in ld. Will be removed soon. */
|
||||
#if defined(__GNUC__)
|
||||
#define __ImageBase __MINGW_LSYMBOL(_image_base__)
|
||||
|
@ -306,12 +312,16 @@ __tmainCRTStartup (void)
|
|||
duplicate_ppstrings (argc, &argv);
|
||||
__main ();
|
||||
#ifdef WPRFLAG
|
||||
#if !defined(__arm__) && !defined(__aarch64__)
|
||||
__winitenv = envp;
|
||||
#endif
|
||||
/* C++ initialization.
|
||||
gcc inserts this call automatically for a function called main, but not for wmain. */
|
||||
mainret = wmain (argc, argv, envp);
|
||||
#else
|
||||
#if !defined(__arm__) && !defined(__aarch64__)
|
||||
__initenv = envp;
|
||||
#endif
|
||||
mainret = main (argc, argv, envp);
|
||||
#endif
|
||||
if (!managedapp)
|
||||
|
|
Loading…
Reference in a new issue