Skip to content

disambiguate size_t to Json::Value assignment on LP64 (macOS)#6

Open
MarcDufresne wants to merge 2 commits into
RecompRando:mainfrom
MarcDufresne:macos-arm64-fix
Open

disambiguate size_t to Json::Value assignment on LP64 (macOS)#6
MarcDufresne wants to merge 2 commits into
RecompRando:mainfrom
MarcDufresne:macos-arm64-fix

Conversation

@MarcDufresne

@MarcDufresne MarcDufresne commented Jun 21, 2026

Copy link
Copy Markdown

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.cpp assigns a size_t into a jsoncpp Json::Value. 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 and won't compile. It builds on Linux x64 only because there uint64_t == unsigned long. Fixed with an explicit static_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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant