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 dfa9a81233
commit 0714847552
82 changed files with 497 additions and 530 deletions

View File

@@ -6,6 +6,7 @@
#pragma once
#include <inttypes.h>
#include "esp_assert.h"
/**
* @brief ESP chip ID
@@ -26,7 +27,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 */
/**
@@ -93,7 +94,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 */