X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fbasic%2Fmacro.h;fp=src%2Fbasic%2Fmacro.h;h=ab5cc97e17ac386a9031c0f61053e699fd2f5a1e;hp=2695d0edb75ba436e645fc1f32786dde78e22bbd;hb=3c84247622c7d6ad51e7a49907995e3e48b5f472;hpb=45e507a05750d43384bfbe90b8b22dfb5a1c5d2a diff --git a/src/basic/macro.h b/src/basic/macro.h index 2695d0edb..ab5cc97e1 100644 --- a/src/basic/macro.h +++ b/src/basic/macro.h @@ -361,6 +361,12 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) { _found; \ }) +#define SWAP_TWO(x, y) do { \ + typeof(x) _t = (x); \ + (x) = (y); \ + (y) = (_t); \ + } while (false) + /* Define C11 thread_local attribute even on older gcc compiler * version */ #ifndef thread_local