Declarations for 2- and 3-argument GetMonData (#1756)

* Type-safe GetMonData/GetBoxMonData

* Comments
This commit is contained in:
Martin Griffin
2023-07-24 14:57:37 +01:00
committed by GitHub
parent 56ec3b6461
commit b53cca1a06
4 changed files with 33 additions and 9 deletions
+7
View File
@@ -134,6 +134,13 @@
#define NUM_FLAG_BYTES ROUND_BITS_TO_BYTES(FLAGS_COUNT)
#define NUM_TRENDY_SAYING_BYTES ROUND_BITS_TO_BYTES(NUM_TRENDY_SAYINGS)
// This returns the number of arguments passed to it (up to 8).
#define NARG_8(...) NARG_8_(_, ##__VA_ARGS__, 8, 7, 6, 5, 4, 3, 2, 1, 0)
#define NARG_8_(_, a, b, c, d, e, f, g, h, N, ...) N
#define CAT(a, b) CAT_(a, b)
#define CAT_(a, b) a ## b
// 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];