Skip to content

Commit 5e58036

Browse files
committed
Update the extern C decalaration. Add __cpluplus block to unity_handler.h
and include that header in unity_handler.cpp.
1 parent 706e5a0 commit 5e58036

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

frameworks/utest/source/unity_handler.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,15 @@
1818

1919
#include "utest/harness.h"
2020
#include "utest/stack_trace.h"
21+
#include "utest/unity_handler.h"
2122

2223

23-
extern "C"
2424
void utest_unity_assert_failure(void)
2525
{
2626
UTEST_LOG_FUNCTION();
2727
utest::v1::Harness::raise_failure(utest::v1::REASON_ASSERTION);
2828
}
2929

30-
extern "C"
3130
void utest_unity_ignore_failure(void)
3231
{
3332
UTEST_LOG_FUNCTION();

frameworks/utest/utest/unity_handler.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,18 @@
2121

2222
#include <stdint.h>
2323

24+
#ifdef __cplusplus
25+
extern "C" {
26+
#endif
27+
2428
/// this function is called from the unity module when an assertion failed.
2529
void utest_unity_assert_failure(void);
2630

2731
/// this function is called from the unity module when an assertion failed, but is ignored.
2832
void utest_unity_ignore_failure(void);
2933

34+
#ifdef __cplusplus
35+
}
36+
#endif
37+
3038
#endif // UTEST_UNITY_ASSERT_FAILURE_H

0 commit comments

Comments
 (0)