diff options
| author | Sebastien Bacher <seb128@ubuntu.com> | 2020-07-02 12:20:27 +0200 |
|---|---|---|
| committer | Sebastien Bacher <seb128@ubuntu.com> | 2020-07-02 12:20:27 +0200 |
| commit | 486e0bef719d78ee55d2166b0bfb4fa684c09854 (patch) | |
| tree | aead4c1cc30eb61a2d9dec70f7c8339904506fad /src/platform/nm-netlink.h | |
| parent | 39143df7aed46e83f8c68ea9ad6d24cfdf5a1dd8 (diff) | |
| parent | 10ae7d8cd706062742d0cdb1803d49909aef9e06 (diff) | |
Merge branch 'upstream/latest' of https://salsa.debian.org/utopia-team/network-manager into upstream/latest
Diffstat (limited to 'src/platform/nm-netlink.h')
| -rw-r--r-- | src/platform/nm-netlink.h | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/platform/nm-netlink.h b/src/platform/nm-netlink.h index 0ac5b3b7..a5124f52 100644 --- a/src/platform/nm-netlink.h +++ b/src/platform/nm-netlink.h @@ -77,17 +77,13 @@ struct nla_policy { /* static asserts that @tb and @policy are suitable arguments to nla_parse(). */ #define _nl_static_assert_tb(tb, policy) \ G_STMT_START { \ - \ G_STATIC_ASSERT_EXPR (G_N_ELEMENTS (tb) > 0); \ \ - /* we allow @policy to be either NULL or a C array. */ \ - G_STATIC_ASSERT_EXPR ( sizeof (policy) == sizeof (NULL) \ - || G_N_ELEMENTS (tb) == (sizeof (policy) / sizeof (struct nla_policy))); \ - \ - /* For above check to work, we don't support policy being an array with same size as - * sizeof(NULL), otherwise, the compile time check breaks down. */ \ - G_STATIC_ASSERT_EXPR (sizeof (NULL) != G_N_ELEMENTS (tb) * sizeof (struct nla_policy)); \ - \ + /* We allow @policy to be either a C array or NULL. The sizeof() + * must either match the expected array size or the sizeof(NULL), + * but not both. */ \ + G_STATIC_ASSERT_EXPR ( (sizeof (policy) == G_N_ELEMENTS (tb) * sizeof (struct nla_policy)) \ + ^ (sizeof (policy) == sizeof (NULL))); \ } G_STMT_END /*****************************************************************************/ |