Add NUMERIC compare macros to simplify code

This commit is contained in:
Scott Lahteine
2016-03-28 03:52:49 -07:00
parent 2e4ddd5c22
commit f1ed310322
2 changed files with 6 additions and 4 deletions

View File

@ -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