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:
parent
99a142bb6b
commit
9890777c72
1 changed files with 7 additions and 0 deletions
|
@ -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))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue