Updated array index check with macro def in log.h

This commit is contained in:
Melissa Elkadi
2021-01-18 11:39:03 -08:00
parent a1ec989d47
commit d0e380da1e
2 changed files with 12 additions and 3 deletions
+6
View File
@@ -54,6 +54,12 @@
#include "T.h"
#include <common/utils/utils.h>
/*----------------------------------------------------------------------------*/
#include <assert.h>
#ifdef NDEBUG
#warning assert is disabled
#endif
#define NUM_ELEMENTS(ARRAY) (sizeof(ARRAY) / sizeof(ARRAY[0]))
#define CHECK_INDEX(ARRAY, INDEX) assert((INDEX) < NUM_ELEMENTS(ARRAY))
#ifdef __cplusplus
extern "C" {