1 // SPDX-FileCopyrightText: 2021 Francis Deslauriers <francis.deslauriers@efficios.com>
3 // SPDX-License-Identifier: MIT
9 * Userspace RCU assertion facilities.
12 #include <urcu/config.h>
15 * Force usage of an expression to prevent unused expression compiler warning.
17 #define _urcu_use_expression(_expr) ((void) sizeof((void) (_expr), 0))
21 * Vanilla assert() replacement. When NDEBUG is defined, the expression is
22 * consumed to prevent unused variable compile warnings.
24 # define urcu_posix_assert(_cond) _urcu_use_expression(_cond)
27 # define urcu_posix_assert(_cond) assert(_cond)
30 #if defined(DEBUG_RCU) || defined(CONFIG_RCU_DEBUG)
33 * Enables debugging/expensive assertions to be used in fast paths and only
34 * enabled on demand. When disabled, the expression is consumed to prevent
35 * unused variable compile warnings.
37 # define urcu_assert_debug(_cond) urcu_posix_assert(_cond)
39 # define urcu_assert_debug(_cond) _urcu_use_expression(_cond)
42 #endif /* _URCU_ASSERT_H */
This page took 0.029926 seconds and 4 git commands to generate.