...
lib_def.h
Prototype
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
DEF_CHK_VAL(val, val_min, val_max);
|
Arguments
val
Value to validate.
...
DEF_CHK_VAL()
does not validate that the maximum value (val_max
) is greater than or equal to the minimum value (val_min
).
Example Usage
Code Block | Language | C++|||
---|---|---|---|---|
| ||||
#define CFG_VAL -1
#if (DEF_CHK_VAL_MAX(CFG_VAL, 0u, 1000u) != DEF_OK) /* Signed CFG_VAL NOT promoted to unsigned. */
#error "CFG_VAL must be >= 0 and <= 100"
#endif
|