From 162ae220b18ff32ee631202567ca85eb69823372 Mon Sep 17 00:00:00 2001 From: Jaeden Amero Date: Thu, 22 Jul 2021 14:00:14 +0100 Subject: [PATCH] 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) --- events/tests/UNITTESTS/doubles/equeue_stub.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/events/tests/UNITTESTS/doubles/equeue_stub.h b/events/tests/UNITTESTS/doubles/equeue_stub.h index fcdddf9e53..168b393198 100644 --- a/events/tests/UNITTESTS/doubles/equeue_stub.h +++ b/events/tests/UNITTESTS/doubles/equeue_stub.h @@ -21,6 +21,10 @@ #include "stdint.h" #include "stdbool.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { void *void_ptr; bool call_cb_immediately; @@ -28,4 +32,8 @@ typedef struct { extern equeue_stub_def equeue_stub; +#ifdef __cplusplus +} +#endif + #endif