disambiguate size_t to Json::Value assignment on LP64 (macOS)#6
Open
MarcDufresne wants to merge 2 commits into
Open
disambiguate size_t to Json::Value assignment on LP64 (macOS)#6MarcDufresne wants to merge 2 commits into
MarcDufresne wants to merge 2 commits into
Conversation
On 64-bit macOS size_t is unsigned long while jsoncpp's uint64_t is unsigned long long (a distinct type), so the assignment is ambiguous across jsoncpp's UInt/Int64/UInt64 converting constructors. It compiles on Linux x64 only because there uint64_t == unsigned long. Cast explicitly to Json::UInt64.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi! While working on macOS support for MMRecompRando I noticed a build issue on macOS specifically. I was able to fix it and successfully build the full MMRecompRando mod for Apple Silicon Macs, connect to AP, send/receive items, etc.
Archipelago.cppassigns asize_tinto ajsoncppJson::Value. On 64-bit macOSsize_tis unsigned long whilejsoncpp'suint64_tis unsigned long long (a distinct type), so the assignment is ambiguous across jsoncpp's UInt/Int64/UInt64 converting constructors and won't compile. It builds on Linux x64 only because thereuint64_t == unsigned long. Fixed with an explicitstatic_cast<Json::UInt64>, harmless on Linux/Windows. I also updated the build instructions for macOS, since it is now fully supported and tested.This unblocks the macOS build on RecompRando/MMRecompAPCppGlue#16
NOTE: This PR needs to be merged first, then I will be able to update the other dependent PR for a clean merge.