mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-05 13:50:15 +01:00
shared: add NM_MAX_WITH_CMP() macro
(cherry picked from commit e0191d4201)
This commit is contained in:
parent
35eedebfcf
commit
7c07c59aa3
1 changed files with 10 additions and 0 deletions
|
|
@ -1324,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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue