1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-30 00:00:11 +01:00

added SWAP() macro

This commit is contained in:
Steffen Vogel 2017-03-25 21:24:06 +01:00
parent 99a142bb6b
commit 9890777c72

View file

@ -55,6 +55,13 @@
#define ALIGN_MASK(x, m) (((uintptr_t) (x) + (m)) & ~(m))
#define IS_ALIGNED(x, a) (ALIGN(x, a) == (uintptr_t) x)
#define SWAP(x,y) do { \
__auto_type _x = x; \
__auto_type _y = y; \
x = _y; \
y = _x; \
} while(0)
/** Round-up integer division */
#define CEIL(x, y) (((x) + (y) - 1) / (y))