Files
dusklight/libs/revolution/src/os/__ppc_eabi_init.cpp
T
Luke Street 9649319ec4 Reorganize library code into libs/ (#3119)
* Reorganize files into libs/{dolphin,JSystem,PowerPC_EABI_Support,revolution,TRK_MINNOW_DOLPHIN}

* Update configure.py and project.py for new libs structure

* Refactor `#include <dolphin/x.h>` -> `<x.h>`

* Remove `__REVOLUTION_SDK__` forwards from dolphin

* Fix dolphin/ references in revolution

* Wrap `#include <dolphin.h>` in `!__REVOLUTION_SDK__`

* Always build TRK against dolphin headers

* Resolve revolution SDK header resolution issues
2026-03-01 14:35:36 -08:00

48 lines
743 B
C++

#include <revolution/base/PPCArch.h>
#ifdef __cplusplus
extern "C" {
#endif
void __init_cpp(void);
void _ExitProcess(void);
typedef void (*voidfunctionptr)();
extern voidfunctionptr _ctors[];
extern voidfunctionptr _dtors[];
void __init_user(void) {
__init_cpp();
}
void __init_cpp(void) {
/**
* call static initializers
*/
voidfunctionptr* constructor;
for (constructor = _ctors; *constructor; constructor++) {
(*constructor)();
}
}
static void __fini_cpp(void) {
voidfunctionptr* dtor;
for (dtor = _dtors; *dtor; dtor++) {
(*dtor)();
}
}
void exit(int status) {
__fini_cpp();
_ExitProcess();
}
void _ExitProcess(void) {
PPCHalt();
}
#ifdef __cplusplus
}
#endif