From c112e5d478e3d12e1a6b51d012b454942e7152e1 Mon Sep 17 00:00:00 2001 From: Peter Bigot Date: Mon, 12 Aug 2019 12:54:36 -0500 Subject: [PATCH] include/dfu: rearrange for standard use of extern "C" in private headers Consistently place C++ use of extern "C" after all include directives, within the negative branch of _ASMLANGUAGE if used. Background from issue #17997: Declarations that use C linkage should be placed within extern "C" so the language linkage is correct when the header is included by a C++ compiler. Similarly #include directives should be outside the extern "C" to ensure the language-specific default linkage is applied to any declarations provided by the included header. See: https://en.cppreference.com/w/cpp/language/language_linkage Signed-off-by: Peter Bigot --- include/dfu/flash_img.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/dfu/flash_img.h b/include/dfu/flash_img.h index 4d2593c01d..a21664b412 100644 --- a/include/dfu/flash_img.h +++ b/include/dfu/flash_img.h @@ -8,12 +8,12 @@ #ifndef ZEPHYR_INCLUDE_DFU_FLASH_IMG_H_ #define ZEPHYR_INCLUDE_DFU_FLASH_IMG_H_ +#include + #ifdef __cplusplus extern "C" { #endif -#include - struct flash_img_context { u8_t buf[CONFIG_IMG_BLOCK_BUF_SIZE]; const struct flash_area *flash_area;