Skip to content

Commit 16c0d62

Browse files
committed
Add sizeof(struct am_event) compile time check
1 parent 66fc096 commit 16c0d62

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libs/event/event.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
#include <stdbool.h>
3737

38+
#include "common/compiler.h"
3839
#include "queue/queue.h"
3940

4041
/** No event ID should have this value. */
@@ -116,6 +117,8 @@ struct am_event {
116117
unsigned pubsub_time : 1;
117118
};
118119

120+
AM_ASSERT_STATIC(sizeof(struct am_event) == (2 * sizeof(int)));
121+
119122
/** Event library state configuration. */
120123
struct am_event_state_cfg {
121124
/** Enter critical section. */

0 commit comments

Comments
 (0)