summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-07-24 09:39:14 +0200
committerThomas Haller <thaller@redhat.com>2020-07-24 16:03:15 +0200
commit8346870aa654177b841029a439aeeb8b82dfba94 (patch)
tree6debd2ef3b7cac4d542f860d37c27ead8818fb91
parent9c09dcedafd51da65c04669b830bc9652000d462 (diff)
downloadNetworkManager-8346870aa654177b841029a439aeeb8b82dfba94.tar.gz
shared: add nm_assert_unreachable_val() macro
-rw-r--r--shared/nm-std-aux/nm-std-aux.h6
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; })