Repository navigation
Conversation
SWIG 4 fails to parse the trailing-return deduced from std::filesystem::path::native(), exiting with a syntax error at ofFileUtils.h:454 when generating bindings (openframeworks#8684). Return std::string explicitly and use path::string() for a consistent cross-platform return type (filename().native() is std::wstring on Windows, std::string elsewhere, so the previous auto silently returned a different type per platform). No upstream callers rely on the deduced type.
danoli3
force-pushed
the
swig-fix-getappname
branch
from
November 27, 2026 09:14
03d9346 to
1bb49fc
Compare
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.
Fixes the SWIG syntax error at
libs/openFrameworks/utils/ofFileUtils.h:454reported in #8684.ofFilePath::getAppName()was declaredstatic const autoand returned the result ofstd::filesystem::path::native(). SWIG 4's C++ parser rejects the trailing-type-deducedautoreturn and bails with a syntax error during binding generation.Return
std::stringexplicitly and switch the body topath::string()+ plainstd::stringsuffixes. This also fixes a latent cross-platform wart:filename().native()isstd::wstringon Windows andstd::stringelsewhere, so the previousautosilently returned a different type per platform.Minimal diff (one file, six lines). No upstream caller relies on the deduced type, so no API fallout. If the pair pattern used by
getCurrentExePath/getCurrentExePathFSis preferred, a companiongetAppNameFS()returningof::filesystem::pathcan be added in a follow-up; per the discussion the recommendation is "whatever passes CI is good enough."