diff options
Diffstat (limited to 'src/shared/macro.h')
-rw-r--r-- | src/shared/macro.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/shared/macro.h b/src/shared/macro.h index 9f5f51cb13..54b641be23 100644 --- a/src/shared/macro.h +++ b/src/shared/macro.h @@ -285,4 +285,17 @@ do { \ #define SET_FLAG(v, flag, b) \ (v) = (b) ? ((v) | (flag)) : ((v) & ~(flag)) +#define IN_SET(x, ...) ({ \ + typeof(x) _x = (x); \ + unsigned _i; \ + bool _found = false; \ + for (_i = 0; _i < sizeof((typeof(_x)[]) { __VA_ARGS__ })/sizeof(typeof(_x)); _i++) \ + if (((typeof(_x)[]) { __VA_ARGS__ })[_i] == _x) { \ + _found = true; \ + break; \ + } \ + _found; \ + }) + + #include "log.h" |