From 798e45b20f57748b9d47c4d95ab8284d7489d7bb Mon Sep 17 00:00:00 2001 From: IndecisiveTurtle <47210458+raphaelthegreat@users.noreply.github.com> Date: Sun, 10 Nov 2024 20:15:28 +0200 Subject: [PATCH] libs: Reduce logging --- src/core/libraries/libs.h | 45 +++------------------------------------ 1 file changed, 3 insertions(+), 42 deletions(-) diff --git a/src/core/libraries/libs.h b/src/core/libraries/libs.h index 375f1abd..aa5ba4a9 100644 --- a/src/core/libraries/libs.h +++ b/src/core/libraries/libs.h @@ -9,46 +9,9 @@ #include "core/loader/elf.h" #include "core/loader/symbols_resolver.h" -template -struct StringLiteral { - constexpr StringLiteral(const char (&str)[N]) { - std::copy_n(str, N, value); - } - - char value[N]; -}; - -template -struct wrapper_impl; - -template -struct wrapper_impl { - static R PS4_SYSV_ABI wrap(Args... args) { - if (std::string_view(name.value) != "scePthreadEqual" && - std::string_view(name.value) != "sceUserServiceGetEvent" && - !std::string_view(name.value).contains("scePthreadMutex") && - !std::string_view(name.value).contains("pthread_mutex")) { - // LOG_WARNING(Core_Linker, "Function {} called", name.value); - } - if constexpr (std::is_same_v || std::is_same_v) { - const u32 ret = f(args...); - if (ret != 0 && !std::string_view(name.value).contains("pthread_equal")) { - LOG_WARNING(Core_Linker, "Function {} returned {:#x}", name.value, ret); - } - return ret; - } - // stuff - return f(args...); - } -}; - -template -constexpr auto wrapper = wrapper_impl::wrap; - -// #define W(foo) wrapper<#foo, decltype(&foo), foo> #define W(foo) foo -#define LIB_FUNCTION(nid, lib, libversion, mod, moduleVersionMajor, moduleVersionMinor, f) \ +#define LIB_FUNCTION(nid, lib, libversion, mod, moduleVersionMajor, moduleVersionMinor, function) \ { \ Core::Loader::SymbolResolver sr{}; \ sr.name = nid; \ @@ -58,10 +21,8 @@ constexpr auto wrapper = wrapper_impl::wrap; sr.module_version_major = moduleVersionMajor; \ sr.module_version_minor = moduleVersionMinor; \ sr.type = Core::Loader::SymbolType::Function; \ - { \ - auto func = reinterpret_cast(wrapper<#f, decltype(&f), f>); \ - sym->AddSymbol(sr, func); \ - } \ + auto func = reinterpret_cast(function); \ + sym->AddSymbol(sr, func); \ } #define LIB_OBJ(nid, lib, libversion, mod, moduleVersionMajor, moduleVersionMinor, function) \