summaryrefslogtreecommitdiffstats
path: root/vppinfra
diff options
context:
space:
mode:
Diffstat (limited to 'vppinfra')
-rw-r--r--vppinfra/vppinfra/error_bootstrap.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/vppinfra/vppinfra/error_bootstrap.h b/vppinfra/vppinfra/error_bootstrap.h
index b03ec88049a..3416c2f9033 100644
--- a/vppinfra/vppinfra/error_bootstrap.h
+++ b/vppinfra/vppinfra/error_bootstrap.h
@@ -85,6 +85,9 @@ do { \
#define STATIC_ASSERT(truth,...) _Static_assert(truth, __VA_ARGS__)
#endif
+#define STATIC_ASSERT_SIZEOF(d, s) \
+ STATIC_ASSERT (sizeof (d) == s, "Size of " #d " must be " # s " bytes")
+
/* Assert without allocating memory. */
#define ASSERT_AND_PANIC(truth) \
do { \