macro: add swap helper

parent a4ade846
...@@ -666,4 +666,11 @@ enum { ...@@ -666,4 +666,11 @@ enum {
#define MAX_FILENO ~0U #define MAX_FILENO ~0U
#define swap(a, b) \
do { \
typeof(a) __tmp = (a); \
(a) = (b); \
(b) = __tmp; \
} while (0)
#endif /* __LXC_MACRO_H */ #endif /* __LXC_MACRO_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment