Add alternative TERN macros
This commit is contained in:
@ -253,6 +253,9 @@
|
||||
#define __TERN(T,V...) ___TERN(_CAT(_NO,T),V) // Prepend '_NO' to get '_NOT_0' or '_NOT_1'
|
||||
#define ___TERN(P,V...) THIRD(P,V) // If first argument has a comma, A. Else B.
|
||||
|
||||
#define IF_ENABLED TERN_
|
||||
#define IF_DISABLED(O,A) _TERN(_ENA_1(O),,A)
|
||||
|
||||
#define ANY(V...) !DISABLED(V)
|
||||
#define NONE(V...) DISABLED(V)
|
||||
#define ALL(V...) ENABLED(V)
|
||||
|
Reference in New Issue
Block a user