C/Cxx: unify static assertions with the macro ESP_STATIC_ASSERT

Closes https://github.com/espressif/esp-idf/issues/9938
This commit is contained in:
Omar Chebib
2022-10-13 12:01:27 +08:00
parent dcaa753f37
commit cd21058097
86 changed files with 506 additions and 463 deletions

View File

@@ -6,6 +6,7 @@
#pragma once
#include <inttypes.h>
#include "esp_assert.h"
/**
* @brief ESP chip ID
@@ -27,7 +28,7 @@ typedef enum {
} __attribute__((packed)) esp_chip_id_t;
/** @cond */
_Static_assert(sizeof(esp_chip_id_t) == 2, "esp_chip_id_t should be 16 bit");
ESP_STATIC_ASSERT(sizeof(esp_chip_id_t) == 2, "esp_chip_id_t should be 16 bit");
/** @endcond */
/**
@@ -101,7 +102,7 @@ typedef struct {
} __attribute__((packed)) esp_image_header_t;
/** @cond */
_Static_assert(sizeof(esp_image_header_t) == 24, "binary image header should be 24 bytes");
ESP_STATIC_ASSERT(sizeof(esp_image_header_t) == 24, "binary image header should be 24 bytes");
/** @endcond */