fix(libSceAppContent): compare the download2 quota through its own 64-bit type #15755

Merged
imellag merged 1 commit from upstream-pr/15755 into main 2026-11-06 22:28:03 +00:00
imellag commented 2026-11-04 12:34:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by imellag on 2026-11-04T12:34:46Z.


What

sceAppContentDownload2Expand (6122c5c42f) keeps the quota in a std::atomic<std::uint64_t> and reads it into a size_t before compare_exchange_weak(current, size). On macOS size_t is unsigned long and std::uint64_t is unsigned long long, so the expected value cannot bind to the atomic's unsigned long long& and libc++ rejects the call:

core/libs/prx/libSceAppContent/Export.cpp:341:51: error: no matching member function for call to 'compare_exchange_weak'
note: candidate function not viable: no known conversion from 'size_t' (aka 'unsigned long') to 'unsigned long long &' for 1st argument

current now has the atomic's own type. On Linux and Windows both names are the same 64-bit type, so nothing changes there.

Tested

macOS 27.2, Apple M4 Pro, x86-64 Release under Rosetta 2. main doesn't build on macOS on its own, so this was built in the support branch support/macos-boot-1103 merged with main b11c7bf84f (the open macOS port PRs #7631, #7804, #4630, #11437 and local build fixes). Without this commit the full build stops at Export.cpp:341. With it, #15700 and #15756 (two other macOS build stops that reached main today) the full build goes through, and ctest -R '^(guest_appcontent|guest_np_common_rtc|guest_np_common_state_predicates)' passes 9 of 9.

tools/check_conventions.py --base upstream/main passes, and tools/pr_overlap.py finds no overlap.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5154306821 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15755). Originally posted by [imellag](https://github.com/imellag) on 2026-11-04T12:34:46Z. --- ### What `sceAppContentDownload2Expand` (6122c5c42f) keeps the quota in a `std::atomic<std::uint64_t>` and reads it into a `size_t` before `compare_exchange_weak(current, size)`. On macOS `size_t` is `unsigned long` and `std::uint64_t` is `unsigned long long`, so the expected value cannot bind to the atomic's `unsigned long long&` and libc++ rejects the call: ``` core/libs/prx/libSceAppContent/Export.cpp:341:51: error: no matching member function for call to 'compare_exchange_weak' note: candidate function not viable: no known conversion from 'size_t' (aka 'unsigned long') to 'unsigned long long &' for 1st argument ``` `current` now has the atomic's own type. On Linux and Windows both names are the same 64-bit type, so nothing changes there. ### Tested macOS 27.2, Apple M4 Pro, x86-64 Release under Rosetta 2. `main` doesn't build on macOS on its own, so this was built in the support branch [`support/macos-boot-1103`](https://github.com/imellag/AnyPS5/commits/support/macos-boot-1103) merged with `main` `b11c7bf84f` (the open macOS port PRs #7631, #7804, #4630, #11437 and local build fixes). Without this commit the full build stops at `Export.cpp:341`. With it, #15700 and #15756 (two other macOS build stops that reached `main` today) the full build goes through, and `ctest -R '^(guest_appcontent|guest_np_common_rtc|guest_np_common_state_predicates)'` passes 9 of 9. `tools/check_conventions.py --base upstream/main` passes, and `tools/pr_overlap.py` finds no overlap. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!15755
No description provided.