| Zeile 49: | Zeile 49: | ||
// Im Linkerskript definiert | // Im Linkerskript definiert | ||
| − | extern "C" | + | extern "C" void* start_ctors; |
| − | extern "C" | + | extern "C" void* end_ctors; |
extern "C" void initializeConstructors(); | extern "C" void initializeConstructors(); | ||
| Zeile 57: | Zeile 57: | ||
void initialiseConstructors() | void initialiseConstructors() | ||
{ | { | ||
| − | + | typedef void (*constructor)(); | |
| − | + | ||
| − | + | constructor* iterator = reinterpret_cast<constructor*>(&start_ctors); | |
| − | + | constructor* last = reinterpret_cast<constructor*>(&end_ctors); | |
| − | + | ||
| − | + | while (iterator != last) | |
| − | + | (*iterator++)(); | |
} | } | ||
</cpp> | </cpp> | ||