forked from KolibriOS/kolibrios
upload sdk
git-svn-id: svn://kolibrios.org@4349 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
27
contrib/sdk/sources/newlib/crt/dllstart.c
Normal file
27
contrib/sdk/sources/newlib/crt/dllstart.c
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
extern void _pei386_runtime_relocator (void);
|
||||
|
||||
typedef void (*ctp)();
|
||||
static void __do_global_ctors ()
|
||||
{
|
||||
extern int __CTOR_LIST__;
|
||||
int *c = &__CTOR_LIST__;
|
||||
c++;
|
||||
while (*c)
|
||||
{
|
||||
ctp d = (ctp)*c;
|
||||
(d)();
|
||||
c++;
|
||||
}
|
||||
}
|
||||
|
||||
int DllStartup(void *module, int reason)
|
||||
{
|
||||
if(reason == 1)
|
||||
{
|
||||
_pei386_runtime_relocator();
|
||||
__do_global_ctors();
|
||||
};
|
||||
|
||||
return 1;
|
||||
};
|
Reference in New Issue
Block a user