summaryrefslogtreecommitdiff
path: root/src/common/packetsstatic_len.h
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-12-16 19:05:34 +0100
committerGitHub <noreply@github.com>2018-12-16 19:05:34 +0100
commitf1f1ef0ff2c9aa7d879df8b959072a7429d2722a (patch)
tree11a7121f30031a2a850015eced3803f060514fa3 /src/common/packetsstatic_len.h
parent41d370cd3308be48b4ce00a50ee46515742978b0 (diff)
parent4b2e8684a9874ba435197936a4a9220510ff671f (diff)
downloadhercules-f1f1ef0ff2c9aa7d879df8b959072a7429d2722a.tar.gz
hercules-f1f1ef0ff2c9aa7d879df8b959072a7429d2722a.tar.bz2
hercules-f1f1ef0ff2c9aa7d879df8b959072a7429d2722a.tar.xz
hercules-f1f1ef0ff2c9aa7d879df8b959072a7429d2722a.zip
Merge pull request #2324 from 4144/updatepackets
Update packets up to 2018-12-12
Diffstat (limited to 'src/common/packetsstatic_len.h')
-rw-r--r--src/common/packetsstatic_len.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/common/packetsstatic_len.h b/src/common/packetsstatic_len.h
index 9ccc4a673..730516c27 100644
--- a/src/common/packetsstatic_len.h
+++ b/src/common/packetsstatic_len.h
@@ -24,6 +24,14 @@
#error packetLen already defined
#endif
+#define DEFINE_PACKET_HEADER(name, id) \
+ STATIC_ASSERT((int32)(PACKET_LEN_##id) == -1 || sizeof(struct PACKET_##name) == \
+ (size_t)PACKET_LEN_##id, "Wrong size PACKET_"#name); \
+ enum { HEADER_##name = id };
+
+#define DEFINE_PACKET_ID(name, id) \
+ enum { HEADER_##name = id };
+
#define packetLen(id, len) PACKET_LEN_##id = (len),
enum packet_lengths {
#include "common/packets_len.h"