extras/fixture: add missing C++ include guards#586
Merged
mvandervoord merged 1 commit intoThrowTheSwitch:masterfrom Dec 3, 2021
igrr:unity_fixture_add_cpp_guards
Merged
extras/fixture: add missing C++ include guards#586mvandervoord merged 1 commit intoThrowTheSwitch:masterfrom igrr:unity_fixture_add_cpp_guards
mvandervoord merged 1 commit intoThrowTheSwitch:masterfrom
igrr:unity_fixture_add_cpp_guards
Conversation
This fixes linking errors when test cases based on Unity fixture are defined in a .cpp file. unity_internals.h doesn't have C++ guards, and is included from unity.h from within C++ header guard block. Same approach is taken in this commit
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.
This fixes linking errors related to
UnityMainwhen test cases based on Unity fixture are defined in a .cpp file.unity_internals.hdoesn't have C++ guards, and is currently included fromunity.hfrom within C++ header guard block.I followed the same approach in
unity_fixture.hmoving it into the guarded block, to make the changes in this PR minimal.It would be slightly cleaner, although more intrusive, to add C++ guards to
unity_internals.hand keep it outside of the C++ guarded block in bothunity.handunity_fixture.h. Please let me know if you prefer this approach, I can update the PR.