Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extras/fixture: add missing C++ include guards #586

Merged
merged 1 commit into from
Dec 3, 2021
Merged

extras/fixture: add missing C++ include guards #586

merged 1 commit into from
Dec 3, 2021

Conversation

igrr
Copy link
Contributor

@igrr igrr commented Dec 3, 2021

This fixes linking errors related to UnityMain when test cases based on Unity fixture are defined in a .cpp file.

unity_internals.h doesn't have C++ guards, and is currently included from unity.h from within C++ header guard block.
I followed the same approach in unity_fixture.h moving 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.h and keep it outside of the C++ guarded block in both unity.h and unity_fixture.h. Please let me know if you prefer this approach, I can update the PR.

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
@mvandervoord mvandervoord merged commit 5cdf81e into ThrowTheSwitch:master Dec 3, 2021
@igrr igrr deleted the unity_fixture_add_cpp_guards branch December 4, 2021 21:42
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.

2 participants