2019-11-03 23:23:43 -06:00
|
|
|
|
2020-01-12 20:45:20 -06:00
|
|
|
#pragma GCC diagnostic push
|
|
|
|
#pragma GCC diagnostic ignored "-Wpedantic"
|
|
|
|
|
2019-11-03 23:23:43 -06:00
|
|
|
extern void (*__preinit_array_start[]) (void);
|
|
|
|
extern void (*__preinit_array_end[]) (void);
|
|
|
|
extern void (*__init_array_start[]) (void);
|
|
|
|
extern void (*__init_array_end[]) (void);
|
|
|
|
|
2020-01-12 20:45:20 -06:00
|
|
|
extern "C" {
|
|
|
|
|
|
|
|
void __libc_init_array() {
|
2019-11-03 23:23:43 -06:00
|
|
|
auto preInits = __preinit_array_end - __preinit_array_start;
|
|
|
|
for (decltype(preInits) i = 0; i < preInits; i++) {
|
|
|
|
__preinit_array_start[i]();
|
|
|
|
}
|
|
|
|
auto inits = __init_array_end - __init_array_start;
|
|
|
|
for (decltype(inits) i = 0; i < inits; i++) {
|
|
|
|
__preinit_array_start[i]();
|
|
|
|
}
|
|
|
|
}
|
2020-01-12 20:45:20 -06:00
|
|
|
|
|
|
|
int main(int argc, const char **argv);
|
|
|
|
|
2020-01-12 21:18:21 -06:00
|
|
|
int c_start() {
|
2020-01-12 20:45:20 -06:00
|
|
|
const char *args[2] = {"", "rom.oxfs"};
|
2020-01-12 21:18:21 -06:00
|
|
|
return main(2, args);
|
2020-01-12 20:45:20 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#pragma GCC diagnostic pop
|