From 09ce7e55d7d4cdf860b981821336bce0a64bc61a Mon Sep 17 00:00:00 2001 From: Glyn Leine Date: Tue, 10 Dec 2024 17:47:47 +0100 Subject: [PATCH] small rework of entry point and some error handling things --- .../core_test/src/core_test/source.cpp | 34 +++++++++++++++++-- libraries/rythe/rythe-standard-library | 2 +- modules/rythe/core | 2 +- premake5.lua | 5 ++- 4 files changed, 38 insertions(+), 5 deletions(-) diff --git a/applications/core_test/src/core_test/source.cpp b/applications/core_test/src/core_test/source.cpp index 923397800..bf072e349 100644 --- a/applications/core_test/src/core_test/source.cpp +++ b/applications/core_test/src/core_test/source.cpp @@ -8,8 +8,38 @@ #include -void RYTHE_CCONV reportModules(rythe::core::Program* program) +enum struct test_error : rsl::errc { + no_error = 0, + hi, + no, + fuck, + you +}; + +void assert_handler( + std::string_view expression, std::string_view file, rsl::size_type line, std::string_view message, bool soft +) +{ + rsl::log::undecoratedln( + soft ? rsl::log::severity::warn : rsl::log::severity::fatal, + "Assertion failed:\t{}\nExpected:\t\t{}\nSource:\t\t\t{}, line {}", message, expression, file, line + ); + + __debugbreak(); +} + +rsl::result RYTHE_CCONV init_program(rythe::core::Program& program) +{ + rsl::asserts::assert_handler = &assert_handler; + + rsl::result result; + rsl::log::debug("Initilizing Core-Application"); - program->addEngineInstance(); + program.addEngineInstance(); + + rsl::append_error(result, test_error::no, "NOPE"); + rsl::append_warning(result, test_error::hi, "HEEEEYYYYY"); + + return result; } diff --git a/libraries/rythe/rythe-standard-library b/libraries/rythe/rythe-standard-library index 933409a38..ad9bb35be 160000 --- a/libraries/rythe/rythe-standard-library +++ b/libraries/rythe/rythe-standard-library @@ -1 +1 @@ -Subproject commit 933409a386e4b5127d0578c8c1a22ac306d122c1 +Subproject commit ad9bb35bede0f6065031bf6b38c96fb4c770df16 diff --git a/modules/rythe/core b/modules/rythe/core index 9d16c2cb5..b3ec839e8 160000 --- a/modules/rythe/core +++ b/modules/rythe/core @@ -1 +1 @@ -Subproject commit 9d16c2cb593bb5b56d6baa6574323b947c68599e +Subproject commit b3ec839e89828224a178f4aca5dcbb75dd5b4ff1 diff --git a/premake5.lua b/premake5.lua index d87e041c4..af425e147 100644 --- a/premake5.lua +++ b/premake5.lua @@ -1,10 +1,13 @@ -- root workspace, all sub-project should be included workspace "rythe" location("build/" .. _ACTION) - configurations { "Debug", "Development", "Release", "Debug-asan", "Release-profiling" } + configurations { "Debug", "Debug-no-inline", "Development", "Release", "Debug-asan", "Release-profiling" } os.chdir(_MAIN_SCRIPT_DIR) +filter("configurations:Debug-no-inline") + defines { "RYTHE_DISABLE_ALWAYS_INLINE" } + local r = require("premake/rythe") r.configure() \ No newline at end of file