summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-03-23 08:00:46 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2020-03-25 16:31:50 +0100
commit682d37702d30c00a50f7f85aded3fa8e22f6f086 (patch)
tree3006021d7b6f2818a2b68f1bbf3495a99f5521b2
parent1704507c490fba2b54387e1b19a222bec91e715e (diff)
downloadNetworkManager-682d37702d30c00a50f7f85aded3fa8e22f6f086.tar.gz
shared: add NM_SWAP() macro
-rw-r--r--shared/nm-glib-aux/nm-macros-internal.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/shared/nm-glib-aux/nm-macros-internal.h b/shared/nm-glib-aux/nm-macros-internal.h
index d54bb3ddda..758a4ec9aa 100644
--- a/shared/nm-glib-aux/nm-macros-internal.h
+++ b/shared/nm-glib-aux/nm-macros-internal.h
@@ -757,6 +757,17 @@ NM_G_ERROR_MSG (GError *error)
/*****************************************************************************/
+#define NM_SWAP(a, b) \
+ G_STMT_START { \
+ typeof (a) _tmp; \
+ \
+ _tmp = (a); \
+ (a) = (b); \
+ (b) = _tmp; \
+ } G_STMT_END
+
+/*****************************************************************************/
+
static inline gboolean
_NM_IN_STRSET_streq (const char *x, const char *s)
{