Skip to content

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

Merged
mvandervoord merged 1 commit intoThrowTheSwitch:masterfrom
igrr:unity_fixture_add_cpp_guards
Dec 3, 2021
Merged

extras/fixture: add missing C++ include guards#586
mvandervoord merged 1 commit intoThrowTheSwitch:masterfrom
igrr:unity_fixture_add_cpp_guards

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