From 6c5152297a28b6330b318a6d7f3c75f1d11a703c Mon Sep 17 00:00:00 2001 From: Orange Date: Thu, 9 Oct 2025 20:08:04 +0300 Subject: [PATCH] Uses correct calling convention for virtual methods Adjusts the virtual method calling convention based on the compiler (_MSC_VER). This ensures compatibility and correct behavior on different platforms. --- include/omath/rev_eng/internal_rev_object.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/omath/rev_eng/internal_rev_object.hpp b/include/omath/rev_eng/internal_rev_object.hpp index 63249fb..033ebd3 100644 --- a/include/omath/rev_eng/internal_rev_object.hpp +++ b/include/omath/rev_eng/internal_rev_object.hpp @@ -26,7 +26,11 @@ namespace omath::rev_eng template ReturnType call_virtual_method(auto... arg_list) { +#ifdef _MSC_VER using VirtualMethodType = ReturnType(__thiscall*)(void*, decltype(arg_list)...); +#else + using VirtualMethodType = ReturnType(__fastcall*)(void*, decltype(arg_list)...); +#endif return (*reinterpret_cast(this))[id](this, arg_list...); } };