summaryrefslogtreecommitdiff
path: root/src/common/packetsstatic_len.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/packetsstatic_len.h')
-rw-r--r--src/common/packetsstatic_len.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common/packetsstatic_len.h b/src/common/packetsstatic_len.h
index 9ccc4a673..8e724cfa8 100644
--- a/src/common/packetsstatic_len.h
+++ b/src/common/packetsstatic_len.h
@@ -24,6 +24,11 @@
#error packetLen already defined
#endif
+#define DEFINE_PACKET_HEADER(name, id) \
+ STATIC_ASSERT(PACKET_LEN_##id == -1 || sizeof(struct PACKET_##name) == \
+ PACKET_LEN_##id, "Wrong size PACKET_"#name); \
+ enum { HEADER_##name = id };
+
#define packetLen(id, len) PACKET_LEN_##id = (len),
enum packet_lengths {
#include "common/packets_len.h"