7 * (C) Copyright 2010-2011 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 * Permission is hereby granted, free of charge, to any person obtaining a copy
10 * of this software and associated documentation files (the "Software"), to deal
11 * in the Software without restriction, including without limitation the rights
12 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 * copies of the Software, and to permit persons to whom the Software is
14 * furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
20 #include <urcu/compiler.h>
24 #define LTTNG_BUG_ON(condition) \
26 if (caa_unlikely(condition)) { \
28 "LTTng BUG in file %s, line %d.\n", \
29 __FILE__, __LINE__); \
34 #define LTTNG_BUILD_BUG_ON(condition) \
35 ((void) sizeof(char[-!!(condition)]))
38 * LTTNG_BUILD_RUNTIME_BUG_ON - check condition at build (if constant) or runtime
39 * @condition: the condition which should be false.
41 * If the condition is a constant and true, the compiler will generate a build
42 * error. If the condition is not constant, a BUG will be triggered at runtime
43 * if the condition is ever true. If the condition is constant and false, no
46 #define LTTNG_BUILD_RUNTIME_BUG_ON(condition) \
48 if (__builtin_constant_p(condition)) \
49 LTTNG_BUILD_BUG_ON(condition); \
51 LTTNG_BUG_ON(condition); \
This page took 0.030385 seconds and 4 git commands to generate.