diff options
author | Thomas Haller <thaller@redhat.com> | 2022-05-06 12:10:41 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2022-05-06 12:20:16 +0200 |
commit | 135a706b60a153a0281e7ef29c00ffb548ec0626 (patch) | |
tree | 93791c98a453309b9e9304238ce6acdcc71af7f8 | |
parent | 0ea11bee7b974e193ffc34b5b1d7f0d5825b263a (diff) | |
download | libnl-135a706b60a153a0281e7ef29c00ffb548ec0626.tar.gz |
utils: add _NL_AUTO_DEFINE_FCN_STRUCT() macro
-rw-r--r-- | include/netlink-private/nl-auto.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/netlink-private/nl-auto.h b/include/netlink-private/nl-auto.h index 4434a5b8..4092782b 100644 --- a/include/netlink-private/nl-auto.h +++ b/include/netlink-private/nl-auto.h @@ -15,6 +15,14 @@ static inline void name(void *v) \ } \ struct _nl_dummy_for_tailing_semicolon +#define _NL_AUTO_DEFINE_FCN_STRUCT(CastType, name, func) \ +static inline void name(CastType *v) \ +{ \ + if (v) \ + func(v); \ +} \ +struct _nl_dummy_for_tailing_semicolon + #define _NL_AUTO_DEFINE_FCN_TYPED0(CastType, name, func) \ static inline void name(CastType *v) \ { \ |