Add NUMERIC compare macros to simplify code
This commit is contained in:
@ -51,6 +51,8 @@
|
||||
#define ENABLED(b) _CAT(SWITCH_ENABLED_, b)
|
||||
#define DISABLED(b) (!_CAT(SWITCH_ENABLED_, b))
|
||||
|
||||
#define NUMERIC(a) ((a) >= '0' && '9' >= (a))
|
||||
#define NUMERIC_SIGNED(a) (NUMERIC(a) || (a) == '-')
|
||||
#define COUNT(a) (sizeof(a)/sizeof(*a))
|
||||
|
||||
#endif //__MACROS_H
|
||||
|
Reference in New Issue
Block a user