From 3132f9442dd9c99786db2b6e29fa8a4c3823b7ab Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Sat, 18 May 2024 21:25:11 -0400 Subject: [PATCH] Better Error Message --- libreborn/include/libreborn/patch.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libreborn/include/libreborn/patch.h b/libreborn/include/libreborn/patch.h index c7cb52d..3583c7e 100644 --- a/libreborn/include/libreborn/patch.h +++ b/libreborn/include/libreborn/patch.h @@ -1,11 +1,10 @@ #pragma once -#ifdef __cplusplus - // Patching Functions -#ifdef REBORN_HAS_PATCH_CODE +#if defined(REBORN_HAS_PATCH_CODE) && defined(__cplusplus) +// Init void reborn_init_patch(); // Replace Call Located At start With A Call To target @@ -18,7 +17,7 @@ template static void _only_call_once() { static bool _has_run = false; if (_has_run) { - IMPOSSIBLE(); + ERR("\"Fancy\" overwrite*() Functions Can Only Be Called Once"); } _has_run = true; } @@ -132,5 +131,3 @@ void _patch_vtable(const char *file, int line, start_t *start, start_t target) { ) #endif - -#endif