diff --git a/loader/include/Geode/utils/terminate.hpp b/loader/include/Geode/utils/terminate.hpp index 295560e1..ed89dc67 100644 --- a/loader/include/Geode/utils/terminate.hpp +++ b/loader/include/Geode/utils/terminate.hpp @@ -2,7 +2,6 @@ #include "../DefaultInclude.hpp" #include "../loader/Log.hpp" -#include <source_location> namespace geode { class Mod; @@ -27,19 +26,14 @@ namespace geode::utils { namespace detail { // This needs to do stuff with `Mod*` which is not included in the file - GEODE_DLL std::string fmtTerminateError(const char* reason, Mod* mod, std::source_location loc); + GEODE_DLL std::string fmtTerminateError(const char* reason, Mod* mod); } template <class = void> [[noreturn]] - void terminate( - std::string const& reason, - Mod* mod = getMod(), - std::source_location loc = std::source_location::current(), - size_t platformCode = GEODE_TERMINATE_EXCEPTION_CODE - ) { + void terminate(std::string const& reason, Mod* mod = getMod(), size_t platformCode = GEODE_TERMINATE_EXCEPTION_CODE) { // Add the error to the logfile - log::error("{}", detail::fmtTerminateError(reason.c_str(), mod, loc)); + log::error("{}", detail::fmtTerminateError(reason.c_str(), mod)); #ifdef GEODE_IS_WINDOWS // If a debugger is attached, start debugging @@ -63,11 +57,7 @@ namespace geode::utils { template <class = void> [[noreturn]] - void unreachable( - std::string const& reason = "Unspecified", - Mod* mod = getMod(), - std::source_location loc = std::source_location::current() - ) { - terminate(reason, mod, loc, GEODE_UNREACHABLE_EXCEPTION_CODE); + void unreachable(std::string const& reason = "Unspecified", Mod* mod = getMod()) { + terminate(reason, mod, GEODE_UNREACHABLE_EXCEPTION_CODE); } } diff --git a/loader/src/utils/terminate.cpp b/loader/src/utils/terminate.cpp index 6e18a428..98641dc0 100644 --- a/loader/src/utils/terminate.cpp +++ b/loader/src/utils/terminate.cpp @@ -3,12 +3,9 @@ using namespace geode::prelude; -std::string geode::utils::detail::fmtTerminateError(const char* reason, Mod* mod, std::source_location loc) { +std::string geode::utils::detail::fmtTerminateError(const char* reason, Mod* mod) { return fmt::format( - "The mod '{}' by {} has deliberately asked the game to crash.\n" - "Reason: {}\n" - "Source: {}::{}():{}:{}", - mod->getID(), mod->getDeveloper(), reason, - loc.file_name(), loc.function_name(), loc.line(), loc.column() + "The mod '{}' by {} has deliberately asked the game to crash.\nReason: {}", + mod->getID(), mod->getDeveloper(), reason ); }