Static assertion for size of save structs

This commit is contained in:
Martin Griffin
2022-05-25 17:46:48 +01:00
parent 2a6e57c082
commit 1cc59acca9
5 changed files with 16 additions and 0 deletions
+4
View File
@@ -135,6 +135,10 @@
#define NUM_FLAG_BYTES ROUND_BITS_TO_BYTES(FLAGS_COUNT)
#define NUM_ADDITIONAL_PHRASE_BYTES ROUND_BITS_TO_BYTES(NUM_ADDITIONAL_PHRASES)
// This produces an error at compile-time if expr is zero.
// It looks like file.c:line: size of array `id' is negative
#define STATIC_ASSERT(expr, id) typedef char id[(expr) ? 1 : -1];
struct Coords8
{
s8 x;