From 1853ee6391c1a4d0d80b6542e0a4e4904c3e13e0 Mon Sep 17 00:00:00 2001 From: CreateSource <72283721+abnormalhare@users.noreply.github.com> Date: Sat, 15 Mar 2025 00:42:42 -0400 Subject: [PATCH] completely finish New and NewMore.cp, for some reason NewMore fails checksum --- configure.py | 10 +++------- include/PowerPC_EABI_Support/Runtime/New.h | 1 + src/Runtime.PPCEABI.H/New.cp | 8 ++++++++ src/Runtime.PPCEABI.H/NewMore.cp | 13 +++++++++++++ 4 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 include/PowerPC_EABI_Support/Runtime/New.h create mode 100644 src/Runtime.PPCEABI.H/New.cp create mode 100644 src/Runtime.PPCEABI.H/NewMore.cp diff --git a/configure.py b/configure.py index 513b0305..f861ee4b 100644 --- a/configure.py +++ b/configure.py @@ -669,16 +669,12 @@ config.libs = [ Object(MatchingFor("GMPE01_00", "GMPE01_01"), "Runtime.PPCEABI.H/__va_arg.c"), Object(MatchingFor("GMPE01_00", "GMPE01_01"), "Runtime.PPCEABI.H/global_destructor_chain.c"), Object(MatchingFor("GMPE01_00", "GMPE01_01"), "Runtime.PPCEABI.H/__mem.c"), - Object(NonMatching, "Runtime.PPCEABI.H/New.cp"), - Object(NonMatching, "Runtime.PPCEABI.H/NewMore.cp"), + Object(MatchingFor("GMPE01_00", "GMPE01_01"), "Runtime.PPCEABI.H/New.cp", extra_cflags=["-Cpp_exceptions on"]), + Object(MatchingFor("GMPE01_00", "GMPE01_01"), "Runtime.PPCEABI.H/NewMore.cp", extra_cflags=["-Cpp_exceptions on", "-RTTI on"]), Object(NonMatching, "Runtime.PPCEABI.H/NMWException.cpp"), Object(MatchingFor("GMPE01_00", "GMPE01_01"), "Runtime.PPCEABI.H/runtime.c"), Object(MatchingFor("GMPE01_00", "GMPE01_01"), "Runtime.PPCEABI.H/__init_cpp_exceptions.cpp"), - Object( - NonMatching, - "Runtime.PPCEABI.H/Gecko_ExceptionPPC.cpp", - extra_cflags=["-Cpp_exceptions on"] - ), + Object(NonMatching, "Runtime.PPCEABI.H/Gecko_ExceptionPPC.cpp", extra_cflags=["-Cpp_exceptions on"]), Object(MatchingFor("GMPE01_00", "GMPE01_01"), "Runtime.PPCEABI.H/GCN_mem_alloc.c"), ], }, diff --git a/include/PowerPC_EABI_Support/Runtime/New.h b/include/PowerPC_EABI_Support/Runtime/New.h new file mode 100644 index 00000000..1ae725b4 --- /dev/null +++ b/include/PowerPC_EABI_Support/Runtime/New.h @@ -0,0 +1 @@ +void operator delete(void* arg0); diff --git a/src/Runtime.PPCEABI.H/New.cp b/src/Runtime.PPCEABI.H/New.cp new file mode 100644 index 00000000..c92b6c29 --- /dev/null +++ b/src/Runtime.PPCEABI.H/New.cp @@ -0,0 +1,8 @@ +#include "PowerPC_EABI_Support/Msl/MSL_C/MSL_Common/alloc.h" +#include "PowerPC_EABI_Support/Runtime/New.h" + +void operator delete(void* arg0) throw() { + if (arg0 != 0) { + free(arg0); + } +} diff --git a/src/Runtime.PPCEABI.H/NewMore.cp b/src/Runtime.PPCEABI.H/NewMore.cp new file mode 100644 index 00000000..326e5356 --- /dev/null +++ b/src/Runtime.PPCEABI.H/NewMore.cp @@ -0,0 +1,13 @@ +#include "PowerPC_EABI_Support/Runtime/New.h" + +namespace std { + class exception { + public: + virtual ~exception(); + virtual const char *what() const { + return "exception"; + } + }; +} + +std::exception::~exception() {}