systemlib: properly check for MULT_COUNT value

Checking with preprocessor directives doesn't have any effect because
MULT_COUNT is an enum value rather than a macro. Thus, since MULT_COUNT is
undefined from the preprocessor perspective, even if the number of items in
`enum MULT_PORTS` (except MULT_COUNT) was greater than 33, the error wouldn't
be raised.
This commit is contained in:
Gustavo Jose de Sousa
2016-02-24 13:25:43 +00:00
committed by Lorenz Meier
parent 9984555faa
commit 955af32b1c
+2 -2
View File
@@ -55,9 +55,9 @@ enum MULT_PORTS {
MULT_COUNT
};
#if defined(__cplusplus)
/* Check max multi port count */
#if (MULT_COUNT > 33)
#error "MULT_COUNT HAS TO BE LESS THAN OR EQUAL 33"
static_assert(MULT_COUNT <= 33, "MULT_COUNT HAS TO BE LESS THAN OR EQUAL 33");
#endif
/* FMU board info, to be stored in the first 64 bytes of the FMU EEPROM */