Skip to content

Commit

Permalink
Make Mingw happy
Browse files Browse the repository at this point in the history
  • Loading branch information
ZehMatt committed Jan 27, 2023
1 parent b111a1f commit 0ac11af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Interop/src/Hook.cpp
Expand Up @@ -155,7 +155,7 @@ namespace OpenLoco::Interop
done = WriteProcessMemory(GetCurrentProcess(), (LPVOID)address, data, i, 0);
if (!done)
{
fprintf(stderr, "WriteProcessMemory failed! address = 0x%08x, size = %u, GetLastError() = 0x%08x", address, i, GetLastError());
fprintf(stderr, "WriteProcessMemory failed! address = 0x%08x, size = %d, GetLastError() = 0x%08x", address, i, GetLastError());
}
#else
done = true;
Expand Down
6 changes: 4 additions & 2 deletions src/Interop/src/Interop.cpp
Expand Up @@ -297,7 +297,8 @@ namespace OpenLoco::Interop
#ifdef _WIN32
if (!ReadProcessMemory(GetCurrentProcess(), (LPVOID)address, data, size, nullptr))
{
fprintf(stderr, "ReadProcessMemory failed! address = 0x%08x, size = %u, GetLastError() = 0x%08x", address, size, GetLastError());
const auto errCode = static_cast<uint32_t>(GetLastError());
fprintf(stderr, "ReadProcessMemory failed! address = 0x%08x, size = %zu, GetLastError() = 0x%08x", address, size, errCode);
throw std::runtime_error("ReadProcessMemory failed");
}
#else
Expand All @@ -311,7 +312,8 @@ namespace OpenLoco::Interop
#ifdef _WIN32
if (!WriteProcessMemory(GetCurrentProcess(), (LPVOID)address, data, size, nullptr))
{
fprintf(stderr, "WriteProcessMemory failed! address = 0x%08x, size = %u, GetLastError() = 0x%08x", address, size, GetLastError());
const auto errCode = static_cast<uint32_t>(GetLastError());
fprintf(stderr, "WriteProcessMemory failed! address = 0x%08x, size = %zu, GetLastError() = 0x%08x", address, size, errCode);
throw std::runtime_error("WriteProcessMemory failed");
}
#else
Expand Down

0 comments on commit 0ac11af

Please sign in to comment.