Commit e3cbbece authored by David Brown's avatar David Brown Committed by David Brown
Browse files

Use _Static_assert on all platforms

This macro is part of the C11 standard.  Remove the use of a specialized macro
just for Zephyr, and use the standard macro for all platforms.  This reduces
dependencies on specific versions of Zephyr.

In addition.  The Zephyr-specific code was using toolchain/gcc.h which
would only work with gcc.h, so doesn't actually address any of the
objections.  If this ever becomes a problem with Zephyr, we can figure
out a proper way to fix this.

Signed-off-by: default avatarDavid Brown <david.brown@linaro.org>
parent 7725652e
Loading
Loading
Loading
Loading
+0 −9
Changes for boot/bootutil/include/bootutil/image.h: 0 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -27,10 +27,6 @@
#include <inttypes.h>
#include <stdbool.h>

#ifdef __ZEPHYR__
#include <toolchain/gcc.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif
@@ -135,13 +131,8 @@ struct image_tlv {
#define MUST_DECRYPT(fap, idx, hdr) \
    ((fap)->fa_id == FLASH_AREA_IMAGE_SECONDARY(idx) && IS_ENCRYPTED(hdr))

#ifdef __ZEPHYR__
BUILD_ASSERT(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

struct enc_key_data;
int bootutil_img_validate(struct enc_key_data *enc_state, int image_index,