Skip to content

fix(libSceNpTrophy2): include <cstddef> for std::size_t in the constants header - #10641

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
maximilianfv:fix/libscenptrophy2-include-cstddef
Oct 27, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
maximilianfv:fix/libscenptrophy2-include-cstddef

Conversation

@maximilianfv

Copy link
Copy Markdown
Contributor

What

core/libs/prx/libSceNpTrophy2/include/NpTrophy2Constants.hpp declares NP_TROPHY2_ICON_SIZE_NONE as std::size_t but includes only <cstdint>. libstdc++ happens to declare std::size_t through that header; libc++ does not, so on macOS tests/GuestNpTrophy2.cpp (guest_nptrophy2_tests) fails to compile:

NpTrophy2Constants.hpp:36:23: error: no type named 'size_t' in namespace 'std'

This adds #include <cstddef>, the header that declares std::size_t. No behaviour changes on any host.

Tested

Apple M1 Pro, macOS 27.0.1, Apple clang (libc++), x86_64 build under Rosetta 2. main alone does not build on macOS, so I built in a tree made of mugurc's macOS series (ci/macos-series-2, 27e968974) merged with main at 522e32e3b6, plus other open macOS fixes, toggling only this change.

  • Without it, ninja -k 0 stops on the error above while compiling guest_nptrophy2_tests.
  • With it, the tree builds and ctest -R nptrophy2 passes (guest_nptrophy2).

Not tested on Linux or Windows; libstdc++ already provides std::size_t there, and the include is correct on every host.

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 (Claude Code found the build error, made the change and wrote this description; I am responsible for every line)

🤖 Generated with Claude Code

…nts header

NpTrophy2Constants.hpp uses std::size_t but includes only <cstdint>.
libstdc++ happens to declare it through that header; libc++ does not,
so guest_nptrophy2_tests fails to compile on macOS with "no type named
'size_t' in namespace 'std'".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head e21db29. The public header uses std::size_t but did not include its declaring header; adding <cstddef> directly fixes the libc++ portability issue without changing behavior. The change is isolated to that include. Hosted eligibility, conventions, intake, labels and progress-report checks pass; product build/test jobs were skipped, so I am relying on the author-reported libc++ build and focused trophy test rather than claiming an independent build. I found no blocking issue.

@wachi35676

Copy link
Copy Markdown
Contributor

Tested head e21db2912e merged onto main acb900c194, Windows 11 (WinLibs GCC 15.2.0) and WSL2 Ubuntu 24.04 (GCC 13.3), BUILD_TESTING=ON. This covers the two hosts listed as not tested.

  • guest_nptrophy2_tests builds, and guest_nptrophy2 passes 2 of 2 runs on both hosts.
  • A file that includes only NpTrophy2Constants.hpp compiles with -std=c++20 -fsyntax-only with MinGW GCC 15.2 at this head, and also at main. That matches what the description says about libstdc++, so the missing include only shows under libc++.

AI-assisted: yes (Claude Code); results above were run on this machine.

@oneandonlydean
oneandonlydean merged commit 024515f into boykopovar:main Oct 27, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants