common: Add support for compile time assertions.

(Allows us to check header lengths are sane)
This commit is contained in:
Solomon Peachy 2020-02-25 20:50:03 -05:00
parent 3407c7ce22
commit a0ca92d25b
1 changed files with 3 additions and 0 deletions

View File

@ -109,6 +109,9 @@
/* To cheat the compiler */
#define UNUSED(expr) do { (void)(expr); } while (0)
/* Compile-time assertions */
#define STATIC_ASSERT(test_for_true) _Static_assert((test_for_true), "(" #test_for_true ") failed")
/* IEEE1284 ID processing */
struct deviceid_dict {
char *key;