Newer
Older
ubixos / src / sys / init / static.c
@apwillia apwillia on 8 Sep 2004 329 bytes Once again, 2.95 is retarded.
#include <lib/kprintf.h>

int static_constructors(void)
{
    extern void (* __ctor_list)();
    void (** l_ctor)() = &__ctor_list;
    int l_ctorCount = *(int *)l_ctor;

    kprintf("Calling static constructors\n");
    
    l_ctor++;
    while(l_ctorCount)
    {
	(*l_ctor)();
	l_ctorCount--;
	l_ctor++;
    }

    return 0;
}