about summary refs log tree commit diff
path: root/shared/nm-utils/nm-macros-internal.h
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2019-02-26 19:02:28 +0100
committerMichael Biebl <biebl@debian.org>2019-02-26 19:02:28 +0100
commit439c9d76f576ae28c73571d444c59d9e95e5ad11 (patch)
tree7591e0b43641131fc049d6d7a0bd19e9e4964a40 /shared/nm-utils/nm-macros-internal.h
parent12aead6b161a3312673ac62686af0350061c0666 (diff)
parent964ae8cc391520440cf5aa13e2b9cc34850ea6c2 (diff)
Update upstream source from tag 'upstream/1.14.6'
Update to upstream version '1.14.6'
with Debian dir ef09251bb8b7a4afa8e2b004d785517d8a2d973d
Diffstat (limited to 'shared/nm-utils/nm-macros-internal.h')
-rw-r--r--shared/nm-utils/nm-macros-internal.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/shared/nm-utils/nm-macros-internal.h b/shared/nm-utils/nm-macros-internal.h
index 084219b4..9059783f 100644
--- a/shared/nm-utils/nm-macros-internal.h
+++ b/shared/nm-utils/nm-macros-internal.h
@@ -639,6 +639,9 @@ NM_G_ERROR_MSG (GError *error)
 #define NM_PROPAGATE_CONST(test_expr, ptr) (ptr)
 #endif
 
+#define NM_MAKE_STRV(...) \
+	((const char *const[]) { __VA_ARGS__, NULL })
+
 /*****************************************************************************/
 
 #define _NM_IN_SET_EVAL_1( op, _x, y)           (_x == (y))
@@ -1321,6 +1324,16 @@ nm_strcmp_p (gconstpointer a, gconstpointer b)
 		     : NM_UNIQ_T(X,xq)); \
 	})
 
+#define NM_MAX_WITH_CMP(cmp, a, b) \
+	({ \
+		typeof (a) _a = (a); \
+		typeof (b) _b = (b); \
+		\
+		(  ((cmp (_a, _b)) >= 0) \
+		 ? _a \
+		 : _b); \
+	})
+
 /*****************************************************************************/
 
 static inline guint