9#ifndef MI_BASE_ASSERT_H
10#define MI_BASE_ASSERT_H
52#ifndef mi_static_assert
54#define mi_static_assert_attribute __attribute__((unused))
56#define mi_static_assert_attribute
58#define mi_static_assert(expr) \
59 typedef mi::base::static_assert_test<static_cast<int>( \
60 sizeof(mi::base::static_assert_failure<static_cast<bool>((expr))>))> \
61 MI_BASE_JOIN(static_assert_instance, __LINE__) mi_static_assert_attribute
65template <
bool>
struct static_assert_failure;
66template <>
struct static_assert_failure<true> {};
67template <
int>
struct static_assert_test {};
69#if defined( mi_base_assert) && ! defined( mi_base_assert_msg) \
70 || ! defined( mi_base_assert) && defined( mi_base_assert_msg)
71error "Only one of mi_base_assert and mi_base_assert_msg has been defined. Please define both."
86#define mi_base_assert(expr) (static_cast<void>(0))
103#define mi_base_assert_msg(expr, msg) (static_cast<void>(0))
111#define mi_base_assert_enabled
112#undef mi_base_assert_enabled
118#define mi_base_assert_enabled
132#if defined(__FUNCSIG__)
133# define MI_BASE_ASSERT_FUNCTION __FUNCSIG__
134#elif defined( __cplusplus) && defined(__GNUC__) && defined(__GNUC_MINOR__) \
135 && ((__GNUC__ << 16) + __GNUC_MINOR__ >= (2 << 16) + 6)
136# define MI_BASE_ASSERT_FUNCTION __PRETTY_FUNCTION__
138# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
139# define MI_BASE_ASSERT_FUNCTION __func__
141# define MI_BASE_ASSERT_FUNCTION ("unknown")
Configuration of the Base API.
std::basic_ostream<C, T> & error(std::basic_ostream<C, T> &ostream)
Manipulator for mi::base::Log_stream.
Definition: ilogger.h:542
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: math.h:22