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