From 89e16e61a2e314046fea7679433a27c9d50af7a8 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sun, 24 Jul 2022 14:07:28 +0200 Subject: [PATCH] Add missing __preinit_user function to use the Cafe OS heap --- source/main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/main.cpp b/source/main.cpp index 63161ab..16efaee 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -3,6 +3,7 @@ #include "utils/logger.h" #include #include +#include #include #include #include @@ -43,6 +44,15 @@ bool CheckRunning() { return true; } +extern "C" void __init_wut_malloc(); + +// Override __preinit_user to use the Cafe OS heap +void __preinit_user(MEMHeapHandle *outMem1, + MEMHeapHandle *outFG, + MEMHeapHandle *outMem2) { + __init_wut_malloc(); +} + int main(int argc, char **argv) { WHBLogUdpInit();