aboutsummaryrefslogtreecommitdiffstats
path: root/include/openbsc/debug.h
diff options
context:
space:
mode:
authorHolger Freyther <zecke@selfish.org>2008-12-28 16:32:41 +0000
committerHolger Freyther <zecke@selfish.org>2008-12-28 16:32:41 +0000
commit1ad732c699f49f1b8314c857c77dc4ac8ae274a7 (patch)
tree296f46d546d32a4ad061bb8101e59c720c6355e2 /include/openbsc/debug.h
parent5e85c8ea4099a8df3520adc167a117dea62564c1 (diff)
[debug.h] Introduce a static assert using the array with negative size trick
It is inspired by the COMPILE_ASSERT from WebKit and is using the well known trick to get compile time assertions.
Diffstat (limited to 'include/openbsc/debug.h')
-rw-r--r--include/openbsc/debug.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/openbsc/debug.h b/include/openbsc/debug.h
index 55a06d110..06c9edd98 100644
--- a/include/openbsc/debug.h
+++ b/include/openbsc/debug.h
@@ -19,6 +19,8 @@
#define DEBUGP(xss, fmt, args...)
#endif
+#define static_assert(exp, name) typedef int dummy##name [(exp) ? 1 : -1];
+
void debugp(unsigned int subsys, char *file, int line, const char *format, ...);
void debug_parse_category_mask(const char* mask);
void debug_use_color(int use_color);