7 * (C) Copyright 2010-2011 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
10 * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
12 * Permission is hereby granted to use or copy this program
13 * for any purpose, provided the above notices are retained on all copies.
14 * Permission to modify the code and to distribute modified code is granted,
15 * provided the above notices are retained, and a notice that the code was
16 * modified is included with the above copyright notice.
19 #include <urcu/compiler.h>
23 #define LTTNG_BUG_ON(condition) \
25 if (caa_unlikely(condition)) { \
27 "LTTng BUG in file %s, line %d.\n", \
28 __FILE__, __LINE__); \
33 #define LTTNG_BUILD_BUG_ON(condition) \
34 ((void) sizeof(char[-!!(condition)]))
37 * LTTNG_BUILD_RUNTIME_BUG_ON - check condition at build (if constant) or runtime
38 * @condition: the condition which should be false.
40 * If the condition is a constant and true, the compiler will generate a build
41 * error. If the condition is not constant, a BUG will be triggered at runtime
42 * if the condition is ever true. If the condition is constant and false, no
45 #define LTTNG_BUILD_RUNTIME_BUG_ON(condition) \
47 if (__builtin_constant_p(condition)) \
48 LTTNG_BUILD_BUG_ON(condition); \
50 LTTNG_BUG_ON(condition); \
This page took 0.046826 seconds and 4 git commands to generate.