replace "context" macro with inline function#5
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes a preprocessor macro (context) from mpi_shared.h—which leaked into downstream translation units and could rewrite unrelated identifiers—and replaces it with a namespaced inline accessor function to avoid collisions (notably with newer h5pp).
Changes:
- Removed
#define context mpi_context::context()fromsrc/green/utils/mpi_shared.h. - Added
green::utils::context()inline function returningmpi_context::context().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
egull
approved these changes
May 12, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5 +/- ##
==========================================
+ Coverage 70.95% 71.09% +0.13%
==========================================
Files 3 4 +1
Lines 210 211 +1
==========================================
+ Hits 149 150 +1
Misses 61 61 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This was referenced May 12, 2026
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.
Replace
#define context mpi_context::context()inmpi_shared.hwith a proper inline functioninline mpi_context& context(). The macro was leaking into downstream translation units and conflicting with thecontextidentifier from newer versions of h5pp.