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

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -10,6 +10,7 @@
#include <stdbool.h>
#include "ets_sys.h"
#include "rsa_pss.h"
#include "esp_assert.h"
#ifdef __cplusplus
extern "C" {
@@ -93,7 +94,7 @@ struct ets_secure_boot_sig_block {
uint8_t _padding[16];
};
_Static_assert(sizeof(ets_secure_boot_sig_block_t) == 1216, "invalid sig block size");
ESP_STATIC_ASSERT(sizeof(ets_secure_boot_sig_block_t) == 1216, "invalid sig block size");
#define SECURE_BOOT_NUM_BLOCKS 3
@@ -103,7 +104,7 @@ struct ets_secure_boot_signature {
uint8_t _padding[4096 - (sizeof(ets_secure_boot_sig_block_t) * SECURE_BOOT_NUM_BLOCKS)];
};
_Static_assert(sizeof(ets_secure_boot_signature_t) == 4096, "invalid sig sector size");
ESP_STATIC_ASSERT(sizeof(ets_secure_boot_signature_t) == 4096, "invalid sig sector size");
#define MAX_KEY_DIGESTS 3