Commit a2e1e499 authored by Alexandre Julliard's avatar Alexandre Julliard

msvcrt: Build the CRT startup code also for non-PE builds.

parent b66e13ef
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
#pragma makedep implib #pragma makedep implib
#endif #endif
#ifdef __MINGW32__
#if _MSVCR_VER >= 140 #if _MSVCR_VER >= 140
#define _UCRT #define _UCRT
#endif #endif
...@@ -34,13 +32,14 @@ ...@@ -34,13 +32,14 @@
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winternl.h"
int __cdecl main(int argc, char **argv, char **env); int __cdecl main(int argc, char **argv, char **env);
static const IMAGE_NT_HEADERS *get_nt_header( void ) static const IMAGE_NT_HEADERS *get_nt_header( void )
{ {
extern IMAGE_DOS_HEADER __ImageBase; IMAGE_DOS_HEADER *dos = (IMAGE_DOS_HEADER *)NtCurrentTeb()->Peb->ImageBaseAddress;
return (const IMAGE_NT_HEADERS *)((char *)&__ImageBase + __ImageBase.e_lfanew); return (const IMAGE_NT_HEADERS *)((char *)dos + dos->e_lfanew);
} }
int __cdecl mainCRTStartup(void) int __cdecl mainCRTStartup(void)
...@@ -65,5 +64,3 @@ int __cdecl mainCRTStartup(void) ...@@ -65,5 +64,3 @@ int __cdecl mainCRTStartup(void)
exit(ret); exit(ret);
return ret; return ret;
} }
#endif
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
#pragma makedep implib #pragma makedep implib
#endif #endif
#ifdef __MINGW32__
#include <stdarg.h> #include <stdarg.h>
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
...@@ -54,5 +52,3 @@ int __cdecl main( int argc, char *argv[] ) ...@@ -54,5 +52,3 @@ int __cdecl main( int argc, char *argv[] )
if (!(info.dwFlags & STARTF_USESHOWWINDOW)) info.wShowWindow = SW_SHOWNORMAL; if (!(info.dwFlags & STARTF_USESHOWWINDOW)) info.wShowWindow = SW_SHOWNORMAL;
return WinMain( GetModuleHandleA(0), 0, cmdline, info.wShowWindow ); return WinMain( GetModuleHandleA(0), 0, cmdline, info.wShowWindow );
} }
#endif
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
#pragma makedep implib #pragma makedep implib
#endif #endif
#ifdef __MINGW32__
#if _MSVCR_VER >= 140 #if _MSVCR_VER >= 140
#define _UCRT #define _UCRT
#endif #endif
...@@ -34,13 +32,14 @@ ...@@ -34,13 +32,14 @@
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winternl.h"
int __cdecl wmain(int argc, WCHAR **argv, WCHAR **env); int __cdecl wmain(int argc, WCHAR **argv, WCHAR **env);
static const IMAGE_NT_HEADERS *get_nt_header( void ) static const IMAGE_NT_HEADERS *get_nt_header( void )
{ {
extern IMAGE_DOS_HEADER __ImageBase; IMAGE_DOS_HEADER *dos = (IMAGE_DOS_HEADER *)NtCurrentTeb()->Peb->ImageBaseAddress;
return (const IMAGE_NT_HEADERS *)((char *)&__ImageBase + __ImageBase.e_lfanew); return (const IMAGE_NT_HEADERS *)((char *)dos + dos->e_lfanew);
} }
int __cdecl wmainCRTStartup(void) int __cdecl wmainCRTStartup(void)
...@@ -65,5 +64,3 @@ int __cdecl wmainCRTStartup(void) ...@@ -65,5 +64,3 @@ int __cdecl wmainCRTStartup(void)
exit(ret); exit(ret);
return ret; return ret;
} }
#endif
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
#pragma makedep implib #pragma makedep implib
#endif #endif
#ifdef __MINGW32__
#include <stdarg.h> #include <stdarg.h>
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
...@@ -56,5 +54,3 @@ int __cdecl wmain( int argc, WCHAR *argv[] ) ...@@ -56,5 +54,3 @@ int __cdecl wmain( int argc, WCHAR *argv[] )
if (!(info.dwFlags & STARTF_USESHOWWINDOW)) info.wShowWindow = SW_SHOWNORMAL; if (!(info.dwFlags & STARTF_USESHOWWINDOW)) info.wShowWindow = SW_SHOWNORMAL;
return wWinMain( GetModuleHandleW(0), 0, cmdline, info.wShowWindow ); return wWinMain( GetModuleHandleW(0), 0, cmdline, info.wShowWindow );
} }
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment