From c1bdb54b6b1448f00d793fd9c7174cd5f7cd7e74 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Thu, 20 Jul 2023 21:59:25 +0200 Subject: [PATCH] Remove asserts from Microsoft Detours wrappers Intermittently causes compile errors, the asserts should be added in the implementation file instead. --- r5dev/thirdparty/detours/include/detours.h | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/r5dev/thirdparty/detours/include/detours.h b/r5dev/thirdparty/detours/include/detours.h index 2f12f73c..4b9e2328 100644 --- a/r5dev/thirdparty/detours/include/detours.h +++ b/r5dev/thirdparty/detours/include/detours.h @@ -882,12 +882,9 @@ template< LONG DetourAttach(_Inout_ T *ppPointer, _In_ T pDetour) noexcept { - LONG result = DetourAttach( + return DetourAttach( reinterpret_cast(ppPointer), reinterpret_cast(pDetour)); - - assert(result == NO_ERROR); - return result; } template< @@ -899,15 +896,12 @@ LONG DetourAttachEx(_Inout_ T *ppPointer, _Out_opt_ T *ppRealTarget, _Out_opt_ T *ppRealDetour) noexcept { - LONG result = DetourAttachEx( + return DetourAttachEx( reinterpret_cast(ppPointer), reinterpret_cast(pDetour), ppRealTrampoline, reinterpret_cast(ppRealTarget), reinterpret_cast(ppRealDetour)); - - assert(result == NO_ERROR); - return result; } template< @@ -916,12 +910,9 @@ template< LONG DetourDetach(_Inout_ T *ppPointer, _In_ T pDetour) noexcept { - LONG result = DetourDetach( + return DetourDetach( reinterpret_cast(ppPointer), reinterpret_cast(pDetour)); - - assert(result == NO_ERROR); - return result; } #endif // __cplusplus >= 201103L || _MSVC_LANG >= 201103L