Skip to content

Fix build on 64bit platforms#19

Open
YoukouTenhouin wants to merge 1 commit intoHearthSim:masterfrom
YoukouTenhouin:master
Open

Fix build on 64bit platforms#19
YoukouTenhouin wants to merge 1 commit intoHearthSim:masterfrom
YoukouTenhouin:master

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