diff --git a/vrclient_x64/cxx.h b/vrclient_x64/cxx.h index 701ab02f..373af218 100644 --- a/vrclient_x64/cxx.h +++ b/vrclient_x64/cxx.h @@ -16,6 +16,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#ifndef __WINE_CXX_H +#define __WINE_CXX_H #include "wine/asm.h" #ifdef _WIN64 @@ -474,3 +476,5 @@ __ASM_BLOCK_BEGIN(type_info_vtables) \ __ASM_VTABLE(type_info, \ VTABLE_ADD_FUNC(type_info_vector_dtor)); \ __ASM_BLOCK_END + +#endif diff --git a/vrclient_x64/flatapi.h b/vrclient_x64/flatapi.h index faf14132..c53d4447 100644 --- a/vrclient_x64/flatapi.h +++ b/vrclient_x64/flatapi.h @@ -1,6 +1,8 @@ /* asm thunks for the flat (FnTable) API */ #ifdef __i386__ + +#include "cxx.h" #include "pshpack1.h" struct thunk { @@ -24,7 +26,11 @@ static inline void init_thunk( struct thunk *thunk, void *this, void *proc, thunk->mov_edx = 0xba; thunk->proc = proc; thunk->jmp = 0xe9; +#ifdef __ASM_USE_THISCALL_WRAPPER thunk->call_flat = (char *)call_flat_method - (char *)(&thunk->call_flat + 1); +#else + thunk->call_flat = (char *)proc - (char *)(&thunk->call_flat + 1); +#endif } #else