Add NUMERIC compare macros to simplify code
This commit is contained in:
parent
2e4ddd5c22
commit
f1ed310322
2 changed files with 6 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue