diff options
author | Thomas Haller <thaller@redhat.com> | 2020-07-24 09:39:14 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-07-24 16:03:15 +0200 |
commit | 8346870aa654177b841029a439aeeb8b82dfba94 (patch) | |
tree | 6debd2ef3b7cac4d542f860d37c27ead8818fb91 | |
parent | 9c09dcedafd51da65c04669b830bc9652000d462 (diff) | |
download | NetworkManager-8346870aa654177b841029a439aeeb8b82dfba94.tar.gz |
shared: add nm_assert_unreachable_val() macro
-rw-r--r-- | shared/nm-std-aux/nm-std-aux.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/shared/nm-std-aux/nm-std-aux.h b/shared/nm-std-aux/nm-std-aux.h index 91cd6c37fa..01409cefbb 100644 --- a/shared/nm-std-aux/nm-std-aux.h +++ b/shared/nm-std-aux/nm-std-aux.h @@ -125,6 +125,12 @@ #define nm_assert_not_reached() do { ; } while (0) #endif +#define nm_assert_unreachable_val(val) \ + ({ \ + nm_assert_not_reached (); \ + (val); \ + }) + #define NM_STATIC_ASSERT(cond) static_assert(cond, "") #define NM_STATIC_ASSERT_EXPR(cond) ({ NM_STATIC_ASSERT (cond); 1; }) |