Skip to content

Commit 9f6723c

Browse files
committed
util: add assert on enum value.
1 parent 4036736 commit 9f6723c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

attribute.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
#define attr_cold __attribute__ ((cold))
1717
#define attr_nonnull __attribute__ ((nonnull))
1818
#define assert_size(type, size) _Static_assert(sizeof(type) == size, "sizeof(" #type ") != " #size)
19+
#define assert_enum(name, value) _Static_assert((name) == (value), "enum value for " #name " != " #value)
1920

2021
#endif

0 commit comments

Comments
 (0)