Add alternative TERN macros

This commit is contained in:
Scott Lahteine
2020-11-07 18:28:29 -06:00
parent 5bf82b34c6
commit 367e717aeb
15 changed files with 26 additions and 20 deletions

View File

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