Use BUILD_ASSERT_MSG instead of _Static_assert in Zephyr
Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
diff --git a/boot/bootutil/include/bootutil/image.h b/boot/bootutil/include/bootutil/image.h
index b2d1d94..6989049 100644
--- a/boot/bootutil/include/bootutil/image.h
+++ b/boot/bootutil/include/bootutil/image.h
@@ -22,6 +22,10 @@
#include <inttypes.h>
+#ifdef __ZEPHYR__
+#include <toolchain/gcc.h>
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -105,8 +109,13 @@
#define IS_ENCRYPTED(hdr) ((hdr)->ih_flags & IMAGE_F_ENCRYPTED)
+#ifdef __ZEPHYR__
+BUILD_ASSERT_MSG(sizeof(struct image_header) == IMAGE_HEADER_SIZE,
+ "struct image_header not required size");
+#else
_Static_assert(sizeof(struct image_header) == IMAGE_HEADER_SIZE,
"struct image_header not required size");
+#endif
int bootutil_img_validate(struct image_header *hdr,
const struct flash_area *fap,