From b04664ddadce607b00d4c9ec6828903f31b3e6f7 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 22 Nov 2015 20:49:47 +0000 Subject: [PATCH 1/1] [CRT] - Don't call global constructors twice on MSVC builds CORE-10562 svn path=/trunk/; revision=70039 --- reactos/lib/sdk/crt/startup/mscmain.c | 34 --------------------------- 1 file changed, 34 deletions(-) diff --git a/reactos/lib/sdk/crt/startup/mscmain.c b/reactos/lib/sdk/crt/startup/mscmain.c index cbac7cb28e4..cffeb0ab4f9 100644 --- a/reactos/lib/sdk/crt/startup/mscmain.c +++ b/reactos/lib/sdk/crt/startup/mscmain.c @@ -20,31 +20,6 @@ #error Unsupported platform #endif -/* - * Initializer / constructor handling - * see http://msdn.microsoft.com/en-us/library/bb918180.aspx - * Destructors are registered from the initializers using atexit() - */ - -extern _PVFV __xi_a[]; -extern _PVFV __xi_z[]; -extern _PVFV __xc_a[]; -extern _PVFV __xc_z[]; - -static -void -__do_xtors( - _PVFV *start, - _PVFV *end) -{ - _PVFV *current; - for (current = start; current < end; current++) - { - if (*current != NULL) - (*current)(); - } -} - void _pei386_runtime_relocator(void) { } @@ -55,13 +30,6 @@ int __mingw_init_ehandler(void) return 1; } -void -__do_global_ctors(void) -{ - __do_xtors(__xi_a, __xi_z); - __do_xtors(__xc_a, __xc_z); -} - BOOL WINAPI _CRT_INIT0(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) @@ -114,8 +82,6 @@ __main(void) initialized = 1; _RTC_Initialize(); - - __do_global_ctors (); } } -- 2.17.1