msvc x64 build fix

This commit is contained in:
flyinghead 2021-07-25 11:47:14 +02:00
parent daac6de533
commit 588d79641a
2 changed files with 9 additions and 2 deletions

View File

@ -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<RUNTIME_FUNCTION *> tables;
std::vector<u16> codes;
#endif
#if defined(__unix__) || defined(__APPLE__)

View File

@ -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);
}