From 92f61b80753994c79a0412c2c1e38b5c57f142a8 Mon Sep 17 00:00:00 2001 From: Brooks Prumo Date: Tue, 14 Jan 2020 12:16:46 -0600 Subject: [PATCH] include: dfu: Add extern "C" in mcuboot.h I ran into a build failure trying to use Zephyr's MCUmgr. It was a missing symbol at link time, and since I am using C++, I looked to see if it was a name mangling issue. The mcuboot.h header file was missing `extern "C"` guards, which was the root cause of the issue. This commit adds C++ support to mcuboot.h by adding in `extern "C"` guards. I validated this change by building and running my DFU application with MCUmgr successfully. Signed-off-by: Brooks Prumo --- include/dfu/mcuboot.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/dfu/mcuboot.h b/include/dfu/mcuboot.h index 0d0f00ba4b2..5aee627f76c 100644 --- a/include/dfu/mcuboot.h +++ b/include/dfu/mcuboot.h @@ -13,6 +13,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** Attempt to boot the contents of slot 0. */ #define BOOT_SWAP_TYPE_NONE 1 @@ -177,4 +181,8 @@ int boot_request_upgrade(int permanent); */ int boot_erase_img_bank(u8_t area_id); +#ifdef __cplusplus +} +#endif + #endif /* ZEPHYR_INCLUDE_DFU_MCUBOOT_H_ */