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

utils: fix implementation of SWAP() for complex objects

This commit is contained in:
Steffen Vogel 2020-08-17 12:49:07 +02:00
parent 1316fe0913
commit 91a7e2632d

View file

@ -72,11 +72,10 @@
#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 &_x = x; \
auto &_y = y; \
x = _y; \
y = _x; \
#define SWAP(x, y) do { \
auto t = x; \
x = y; \
y = t; \
} while (0)
/** Round-up integer division */