summaryrefslogtreecommitdiff
path: root/src/basic/macro.h
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2017-01-04 06:40:46 +0100
committerSven Eden <yamakuzure@gmx.net>2017-03-14 10:18:46 +0100
commit21ecddbbb2c9e06d080b2526a870898a8b90f52a (patch)
tree458198518cde60db77fc2acc0191a082e37dea33 /src/basic/macro.h
parent54ce5835917e44761df5c7071fa9111f5be4008a (diff)
Prep v225: Applying various fixes and changes to src/basic that got lost during git am transfer.
Diffstat (limited to 'src/basic/macro.h')
-rw-r--r--src/basic/macro.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/basic/macro.h b/src/basic/macro.h
index 58530a398..627d768b7 100644
--- a/src/basic/macro.h
+++ b/src/basic/macro.h
@@ -407,12 +407,12 @@ do { \
#define IN_SET(x, y, ...) \
({ \
- const typeof(y) _y = (y); \
- const typeof(_y) _x = (x); \
+ static const typeof(y) _array[] = { (y), __VA_ARGS__ }; \
+ const typeof(y) _x = (x); \
unsigned _i; \
bool _found = false; \
- for (_i = 0; _i < 1 + sizeof((const typeof(_x)[]) { __VA_ARGS__ })/sizeof(const typeof(_x)); _i++) \
- if (((const typeof(_x)[]) { _y, __VA_ARGS__ })[_i] == _x) { \
+ for (_i = 0; _i < ELEMENTSOF(_array); _i++) \
+ if (_array[_i] == _x) { \
_found = true; \
break; \
} \