diff --git a/core/oslib/oslib.h b/core/oslib/oslib.h index 15f3709f5..7c7744bb9 100644 --- a/core/oslib/oslib.h +++ b/core/oslib/oslib.h @@ -46,8 +46,15 @@ namespace hostfs } #ifdef _WIN64 +#ifdef __MINGW64__ struct _RUNTIME_FUNCTION; +typedef struct _RUNTIME_FUNCTION RUNTIME_FUNCTION; +#else +struct _IMAGE_RUNTIME_FUNCTION_ENTRY; +typedef struct _IMAGE_RUNTIME_FUNCTION_ENTRY RUNTIME_FUNCTION; #endif +#endif + class UnwindInfo { public: @@ -63,7 +70,7 @@ public: private: u8 *startAddr; #ifdef _WIN64 - std::vector<_RUNTIME_FUNCTION *> tables; + std::vector tables; std::vector codes; #endif #if defined(__unix__) || defined(__APPLE__) diff --git a/core/windows/unwind_info.cpp b/core/windows/unwind_info.cpp index da2e147f2..da79e384e 100644 --- a/core/windows/unwind_info.cpp +++ b/core/windows/unwind_info.cpp @@ -65,7 +65,7 @@ void UnwindInfo::endProlog(u32 offset) codes.push_back(0); std::reverse(codes.begin(), codes.end()); codes[0] = 1 | (offset << 8); - codes[1] = codes.size() - 2; + codes[1] = (u8)codes.size() - 2; if (codes.size() & 1) codes.push_back(0); }