lib/util: Add build_assert()
authorJeremy Kerr <jk@ozlabs.org>
Mon, 21 Oct 2013 06:00:14 +0000 (14:00 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Wed, 13 Nov 2013 09:21:47 +0000 (17:21 +0800)
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
lib/util/util.h

index 8c08dc52eafd7e812949c78fba01e7f8b051a674..ba5ea4f677776fbc0b9c48c38003c21203033848 100644 (file)
@@ -44,5 +44,8 @@
                _max_a > _max_b ? _max_a : _max_b;      \
                })
 
+#define build_assert(x) \
+       do { (void)sizeof(char[(x)?1:-1]); } while (0)
+
 #endif /* UTIL_H */