diff options
author | Thomas Haller <thaller@redhat.com> | 2021-06-04 23:36:45 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2021-06-08 08:24:10 +0200 |
commit | 9823ae75e535f41f2ed1e5cc8c743589dfeb8fff (patch) | |
tree | dbf643a81f848be44feb6dba4b2263455590fd05 | |
parent | 2c3abc7bcbd3b10a204a2730134e35d61bf84f0e (diff) | |
download | NetworkManager-9823ae75e535f41f2ed1e5cc8c743589dfeb8fff.tar.gz |
std-aux: add _NM_MACRO_IDENTITY(), _NM_MACRO_CALL2(), _NM_MACRO_SELECT_FIRST()
_NM_MACRO_CALL2() is needed, because we cannot call _NM_MACRO_CALL() inside
_NM_MACRO_CALL().
-rw-r--r-- | src/libnm-std-aux/nm-std-aux.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libnm-std-aux/nm-std-aux.h b/src/libnm-std-aux/nm-std-aux.h index 3311137dc6..fce64a3363 100644 --- a/src/libnm-std-aux/nm-std-aux.h +++ b/src/libnm-std-aux/nm-std-aux.h @@ -475,7 +475,13 @@ nm_streq0(const char *s1, const char *s2) /*****************************************************************************/ -#define _NM_MACRO_CALL(macro, ...) macro(__VA_ARGS__) +#define _NM_MACRO_IDENTITY(...) __VA_ARGS__ + +#define _NM_MACRO_SELECT_FIRST(...) _NM_MACRO_SELECT_FIRST_IMPL(__VA_ARGS__, throwaway) +#define _NM_MACRO_SELECT_FIRST_IMPL(first, ...) first + +#define _NM_MACRO_CALL(macro, ...) macro(__VA_ARGS__) +#define _NM_MACRO_CALL2(macro, ...) macro(__VA_ARGS__) /*****************************************************************************/ |