Add M_SWAP macro.

This commit is contained in:
Patrick Pelissier committed 2017-03-14 21:20:52 +01:00
1 parent 3265c9fb4d
commit dc87d7e137
1 file changed
+6
+6
View File
@@ -555,6 +555,12 @@
/* Is the number a power of 2? (computed in compile time) */
#define M_POWEROF2_P(n) (!((n)&((n)-1)))
/* Swap two types */
#define M_SWAP(type, x, y) do { \
type tmp = (x); \
(x) = (y); \
(y) = tmp; \
} while (0)
/************************************************************/
/********************* HASH selection ***********************/