Reactos
at master 88 lines 1.5 kB view raw
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#include <stdio.h> 10#include <stdarg.h> 11#include <rtcapi.h> 12#include <assert.h> 13#include <internal.h> 14 15#if defined(_M_IX86) 16#pragma comment(linker, "/alternatename:__RTC_Initialize=__RTC_NoInitialize") 17#elif defined(_M_IA64) || defined(_M_AMD64) || defined(_M_ARM) || defined(_M_ARM64) 18#pragma comment(linker, "/alternatename:_RTC_Initialize=_RTC_NoInitialize") 19#else 20#error Unsupported platform 21#endif 22 23void _pei386_runtime_relocator(void) 24{ 25} 26 27int __mingw_init_ehandler(void) 28{ 29 /* Nothing to do */ 30 return 1; 31} 32 33BOOL 34WINAPI 35_CRT_INIT0(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) 36{ 37 return TRUE; 38} 39 40int 41__cdecl 42Catch_RTC_Failure( 43 int errType, 44 const wchar_t *file, 45 int line, 46 const wchar_t *module, 47 const wchar_t *format, 48 ...) 49{ 50 /* FIXME: better failure routine */ 51 __debugbreak(); 52 return 0; 53} 54 55extern 56void 57__cdecl 58_RTC_NoInitialize(void) 59{ 60 /* Do nothing, if RunTmChk.lib is not pulled in */ 61} 62 63_RTC_error_fnW 64__cdecl 65_CRT_RTC_INITW( 66 void *_Res0, 67 void **_Res1, 68 int _Res2, 69 int _Res3, 70 int _Res4) 71{ 72 return &Catch_RTC_Failure; 73} 74 75static int initialized = 0; 76 77void 78__main(void) 79{ 80 if (!initialized) 81 { 82 initialized = 1; 83 84 _RTC_Initialize(); 85 } 86} 87 88