Skip to content

Build with -std=c++14 and own PowerWatch with unique_ptr - #4

Merged
DefKorns merged 1 commit into
masterfrom
build/cxx14
Oct 21, 2026
Merged

DefKorns merged 1 commit into
masterfrom
build/cxx14

Conversation

@DefKorns

Copy link
Copy Markdown
Owner

Moves the Options Menu build from -std=c++11 to -std=c++14 and replaces the last bare new/delete pair with std::make_unique (Core Guidelines R.11/R.23).

Changes

  • Makefile: -std=c++11 → -std=c++14. The Linaro GCC 4.9.4 toolchain supports C++14.
  • SDL_Context::powerwatch: now a std::unique_ptr<PowerWatch> created with std::make_unique, and the manual delete in the destructor is gone. The member is destroyed after the destructor body, so PowerWatch is still released after SDL_Quit(), as before. Callers use powerwatch->buttonPress() unchanged.

Compatibility

  • No new runtime dependency: every binary in the .hmod needs the same GLIBCXX symbol versions as the C++11 build (compared with objdump -T). make_unique is header-only.
  • SDL_Context is no longer copyable: it holds a unique_ptr now. No code copies it, and copying it before would have deleted powerwatch twice.
  • Add-ons with a vendored Options Menu: they compile the framework with their own flags, so they need C++14 before bumping the submodule. om_theme-selector, the gamepad tool and om-favorites are already on C++14.

Testing

  • Plain and compat builds succeed with no warnings.
  • Host characterization tests (local harness) pass with -std=c++14.
  • Console (SNES Classic, plain build): options, save_manager and mod_uninstall installed.
    • Opening a submenu and going back works.
    • Save Manager and Module Uninstaller open and close.
    • The reset button (the powerwatch path) resumes the UI.

@DefKorns
DefKorns merged commit 24efd93 into master Oct 21, 2026
4 checks passed
@DefKorns
DefKorns deleted the build/cxx14 branch October 21, 2026 00:12
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