Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build on 64bit platforms #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

YoukouTenhouin
Copy link

Previously crn_decompile.h made several assumptions that no longer holds
on 64-bit platform and thus will cause a compilation error. More
specifically:

It assumes that pointers are 4 bytes long, while on 64-bit pointers
are 8 bytes long.
It assumes (unsigned) long and (u)int64 are different types, while on
many 64-bit implementations they are the same.

This commit fixes those problem by changing multiple typedefs from using
built-in integer types to typedefs in , and make pointers cast
to std::uintptr_t rather than uint32. This should ensure successful
compilation on both 32-bit and 64-bit platforms.

fixes #6

Previously crn_decompile.h made several assumptions that no longer holds
on 64-bit platform and thus will cause a compilation error. More
specifically:

It assumes that pointers are 4 bytes long, while on 64-bit pointers
are 8 bytes long.
It assumes (unsigned) long and (u)int64 are different types, while on
many 64-bit implementations they are the same.

This commit fixes those problem by changing multiple typedefs from using
built-in integer types to typedefs in <cstdint>, and make pointers cast
to std::uintptr_t rather than uint32. This should ensure successful
compilation on both 32-bit and 64-bit platforms.
@APN-Pucky
Copy link

APN-Pucky commented Jan 15, 2022

Thank you. This fixes the same error in HearthSim/UnityPack#97

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Error building, loses precision
2 participants