2 * Copyright (C) 2010-2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
4 * SPDX-License-Identifier: MIT
11 #include <urcu/compiler.h>
15 #define LTTNG_BUG_ON(condition) \
17 if (caa_unlikely(condition)) { \
19 "LTTng BUG in file %s, line %d.\n", \
20 __FILE__, __LINE__); \
25 #define LTTNG_BUILD_BUG_ON(condition) \
26 ((void) sizeof(char[-!!(condition)]))
29 * LTTNG_BUILD_RUNTIME_BUG_ON - check condition at build (if constant) or runtime
30 * @condition: the condition which should be false.
32 * If the condition is a constant and true, the compiler will generate a build
33 * error. If the condition is not constant, a BUG will be triggered at runtime
34 * if the condition is ever true. If the condition is constant and false, no
37 #define LTTNG_BUILD_RUNTIME_BUG_ON(condition) \
39 if (__builtin_constant_p(condition)) \
40 LTTNG_BUILD_BUG_ON(condition); \
42 LTTNG_BUG_ON(condition); \
This page took 0.032292 seconds and 4 git commands to generate.