4eba46f1ac6c988b6ed58602479400eb86925769
[reactos.git] / reactos / lib / sdk / crt / startup / mscmain.c
1 /**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the w64 mingw-runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6
7 #include <windows.h>
8 #include <stdlib.h>
9
10 void _pei386_runtime_relocator(void)
11 {
12 }
13
14 int __mingw_init_ehandler(void)
15 {
16 /* Nothing to do */
17 return 1;
18 }
19
20 void
21 __do_global_dtors(void)
22 {
23
24 }
25
26 void
27 __do_global_ctors(void)
28 {
29
30 }
31
32 BOOL
33 WINAPI
34 _CRT_INIT0(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
35 {
36 return TRUE;
37 }
38
39 void Catch_RTC_Failure(int errType, const wchar_t *file, int line,
40 const wchar_t *module, const wchar_t *format, ...)
41 {
42 /* FIXME: better failure routine */
43 __debugbreak();
44 }
45
46 void* __cdecl _CRT_RTC_INITW(void *res0, void **res1, int res2, int res3, int res4)
47 {
48 return &Catch_RTC_Failure;
49 }
50
51 static int initialized = 0;
52
53 void
54 __main(void)
55 {
56 if (!initialized)
57 {
58 initialized = 1;
59 __do_global_ctors ();
60 }
61 }
62
63