Skip to content

Commit 6774c20

Browse files
committed
equeue: Enable use of stub from C++
Add extern "C" to the equeue_stub declaration to avoid an error when a C file implements the equeue_stub symbol (as we do in equeue_stub.c). Undefined symbols for architecture x86_64: "_equeue_stub", referenced from: Test_LoRaWANTimer_start_Test::TestBody() in Test_LoRaWANTimer.cpp.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
1 parent d418c01 commit 6774c20

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

events/tests/UNITTESTS/doubles/equeue_stub.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,19 @@
2121
#include "stdint.h"
2222
#include "stdbool.h"
2323

24+
#ifdef __cplusplus
25+
extern "C" {
26+
#endif
27+
2428
typedef struct {
2529
void *void_ptr;
2630
bool call_cb_immediately;
2731
} equeue_stub_def;
2832

2933
extern equeue_stub_def equeue_stub;
3034

35+
#ifdef __cplusplus
36+
}
37+
#endif
38+
3139
#endif

0 commit comments

Comments
 (0)