Use BUILD_ASSERT_MSG instead of _Static_assert in Zephyr
#include <inttypes.h>
+#ifdef __ZEPHYR__
+#include <toolchain/gcc.h>
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -105,8 +109,13 @@ struct image_tlv {
#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,
