From 2b55d972ca00197b54763d70fdfb1eeae731d442 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 18 Oct 2014 21:38:07 +0000 Subject: [PATCH] [CRT] Implement __do_global_ctors for MSVC svn path=/trunk/; revision=64817 --- reactos/lib/sdk/crt/startup/mscmain.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/reactos/lib/sdk/crt/startup/mscmain.c b/reactos/lib/sdk/crt/startup/mscmain.c index a7f57a47539..873139adee8 100644 --- a/reactos/lib/sdk/crt/startup/mscmain.c +++ b/reactos/lib/sdk/crt/startup/mscmain.c @@ -10,6 +10,7 @@ #include #include #include +#include #if defined(_M_IX86) #pragma comment(linker, "/alternatename:__RTC_Initialize=__RTC_NoInitialize") @@ -19,6 +20,25 @@ #error Unsupported platform #endif +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) { } @@ -38,7 +58,8 @@ __do_global_dtors(void) void __do_global_ctors(void) { - + __do_xtors(__xi_a, __xi_z); + __do_xtors(__xc_a, __xc_z); } BOOL -- 2.17.1