summaryrefslogtreecommitdiff
path: root/shared/nm-glib-aux/nm-macros-internal.h
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-03-23 08:00:46 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2020-03-26 21:28:56 +0100
commitcec06138f173d0dd969dba5acdb3cde4a92884a4 (patch)
tree642310487b016596a922efb1af9b11b3371fef2f /shared/nm-glib-aux/nm-macros-internal.h
parent4fe46d9e20eefa0581d307a02eb8f702c882c73c (diff)
downloadNetworkManager-cec06138f173d0dd969dba5acdb3cde4a92884a4.tar.gz
shared: add NM_SWAP() macro
Diffstat (limited to 'shared/nm-glib-aux/nm-macros-internal.h')
-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)
{